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-2009 Kevin Rosenberg
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License (version 2) as
14 ** published by the Free Software Foundation.
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ** GNU General Public License for more details.
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ******************************************************************************/
32 #include <wx/thread.h>
33 #include <wx/progdlg.h>
35 #include "backgroundsupr.h"
40 class PhantomFileDocument;
41 class ProjectorWorker;
42 class ProjectionFileView;
44 class ProjectorSupervisorThread : public SupervisorThread {
46 PhantomFileView* m_pPhantomView;
49 const int m_iOffsetView;
50 const std::string m_strGeometry;
52 const double m_dRotation;
53 const double m_dFocalLength;
54 const double m_dCenterDetectorLength;
55 const double m_dViewRatio;
56 const double m_dScanRatio;
57 const wxString m_strLabel;
60 ProjectorSupervisorThread(PhantomFileView* pProjView, int iNDet, int iNView, int iOffsetView,
61 const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dCenterDetectorLength,
62 double dViewRatio, double dScanRatio, wxChar const* strLabel);
64 virtual wxThread::ExitCode Entry();
66 virtual void OnExit();
71 class ProjectorSupervisor : public BackgroundSupervisor {
74 std::vector<Projections*> m_vecpChildProjections;
75 PhantomFileView* m_pPhantomView;
76 PhantomFileDocument* m_pPhantomDoc;
81 const int m_iOffsetView;
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 wxString m_strLabel;
93 ProjectorSupervisor (SupervisorThread* pThread, PhantomFileView* pProjView, int iNDet, int iNView, int iOffsetView,
94 const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dCenterDetectorLength,
95 double dViewRatio, double dScanRatio, wxChar 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;
118 const char* m_pszGeometry;
121 double m_dFocalLength;
122 double m_dCenterDetectorLength;
128 ProjectorWorker (ProjectorSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
129 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
132 void SetParameters (PhantomFileView* pPhantomFile, Projections* pProjections, Scanner* pScanner,
133 int iNDet, int iView, int iOffsetView,
134 const char* const pszGeometry, int iNSample, double dRotation, double dFocalLength, double dCenterDetectorLength,
135 double dViewRatio, double dScanRatio);
137 virtual wxThread::ExitCode Entry(); // thread execution starts here
139 virtual void OnExit();
143 #endif // HAVE_WXTHREADS
144 #endif // _THREADPROJ_H_