1 /*****************************************************************************
5 ** Purpose: Header file for thread reconstructions
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: February 2001
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2001 Kevin Rosenberg
12 ** $Id: threadproj.h,v 1.6 2001/03/04 04:27:55 kevin Exp $
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
34 #include <wx/thread.h>
35 #include <wx/progdlg.h>
37 #include "backgroundsupr.h"
42 class PhantomFileDocument;
43 class ProjectorWorker;
44 class ProjectionFileView;
46 class ProjectorSupervisorThread : public SupervisorThread {
48 PhantomFileView* m_pPhantomView;
51 const std::string m_strGeometry;
53 const double m_dRotation;
54 const double m_dFocalLength;
55 const double m_dCenterDetectorLength;
56 const double m_dViewRatio;
57 const double m_dScanRatio;
58 const std::string m_strLabel;
61 ProjectorSupervisorThread(PhantomFileView* pProjView, int iNDet, int iNView,
62 const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dCenterDetectorLength,
63 double dViewRatio, double dScanRatio, const char* const pszLabel);
65 virtual wxThread::ExitCode Entry();
67 virtual void OnExit();
72 class ProjectorSupervisor : public BackgroundSupervisor {
75 std::vector<Projections*> m_vecpChildProjections;
76 PhantomFileView* m_pPhantomView;
77 PhantomFileDocument* m_pPhantomDoc;
82 const char* const m_pszGeometry;
84 const double m_dRotation;
85 const double m_dFocalLength;
86 const double m_dCenterDetectorLength;
87 const double m_dViewRatio;
88 const double m_dScanRatio;
89 const char* const m_pszLabel;
93 ProjectorSupervisor (SupervisorThread* pThread, PhantomFileView* pProjView, int iNDet, int iNView,
94 const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dCenterDetectorLength,
95 double dViewRatio, double dScanRatio, const char* const pszLabel);
97 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
99 virtual ~ProjectorSupervisor ();
103 Projections* getProjections();
110 class ProjectorWorker : public BackgroundWorkerThread {
112 PhantomFileView* m_pPhantomView;
113 Projections* m_pProjections;
117 const char* m_pszGeometry;
120 double m_dFocalLength;
121 double m_dCenterDetectorLength;
127 ProjectorWorker (ProjectorSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
128 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
131 void SetParameters (PhantomFileView* pPhantomFile, Projections* pProjections, Scanner* pScanner,
132 int iNDet, int iView,
133 const char* const pszGeometry, int iNSample, double dRotation, double dFocalLength, double dCenterDetectorLength,
134 double dViewRatio, double dScanRatio);
136 virtual wxThread::ExitCode Entry(); // thread execution starts here
138 virtual void OnExit();
142 #endif // HAVE_WXTHREADS
143 #endif // _THREADPROJ_H_