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
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 ******************************************************************************/
28 #ifndef _THREADRECON_H
29 #define _THREADRECON_H
35 #include <wx/thread.h>
36 #include <wx/progdlg.h>
38 #include "backgroundsupr.h"
43 class ProjectionFileDocument;
44 class ReconstructorWorker;
45 class ProjectionFileView;
46 struct ReconstructionROI;
48 class ReconstructorSupervisorThread : public SupervisorThread {
50 ProjectionFileView* m_pProjView;
51 ImageFile* m_pImageFile;
54 const std::string m_strFilterName;
55 const double m_dFilterParam;
56 const std::string m_strFilterMethod;
58 const std::string m_strFilterGenerationName;
59 const std::string m_strInterpName;
60 const int m_iInterpParam;
61 const std::string m_strBackprojectName;
62 const wxString m_strLabel;
63 ReconstructionROI m_reconROI;
64 const bool m_bRebinToParallel;
67 ReconstructorSupervisorThread(ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName,
68 double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName,
69 const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, wxChar const* pszLabel,
70 ReconstructionROI* pROI, bool bRebinToParallel);
72 virtual wxThread::ExitCode Entry();
74 virtual void OnExit();
79 class ReconstructorSupervisor : public BackgroundSupervisor {
82 std::vector<ImageFile*> m_vecpChildImageFile;
83 const Projections* m_pProj;
84 ProjectionFileView* m_pProjView;
85 ProjectionFileDocument* m_pProjDoc;
90 const char* const m_pszFilterName;
91 const double m_dFilterParam;
92 const char* const m_pszFilterMethod;
94 const char* const m_pszFilterGenerationName;
95 const char* const m_pszInterpName;
96 const int m_iInterpParam;
97 const char* const m_pszBackprojectName;
98 const wxString m_strLabel;
99 ReconstructionROI* m_pReconROI;
102 ReconstructorSupervisor (SupervisorThread* pMyThread, Projections* pProj, ProjectionFileView* pProjView,
103 int iNX, int iNY, const char* pszFilterName, double dFilterParam, const char* pszFilterMethod, int iZeropad,
104 const char* pszFilterGenerationName, const char* pszInterpName, int iInterpParam,
105 const char* pszBackprojectName, wxChar const* pszLabel, ReconstructionROI* pReconROI);
107 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
109 virtual ~ReconstructorSupervisor ();
113 ImageFile* getImageFile();
118 class ReconstructorWorker : public BackgroundWorkerThread {
120 const Projections* m_pProj;
121 ProjectionFileView* m_pProjView;
122 ImageFile* m_pImageFile;
123 const char* m_pszFilterName;
124 double m_dFilterParam;
125 const char* m_pszFilterMethod;
127 const char* m_pszFilterGenerationName;
128 const char* m_pszInterpName;
130 const char* m_pszBackprojectName;
131 ReconstructionROI* m_pReconROI;
134 ReconstructorWorker (ReconstructorSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
135 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
138 void SetParameters (const Projections* pProj, ProjectionFileView* pProjFile, ImageFile* pImageFile,
139 const char* const pszFilterName, double dFilterParam, const char* const pszFilterMethod,
140 int iZeropad, const char* const pszFilterGenerationName, const char* const pszInterpName, int iInterpParam,
141 const char* pszBackprojectName, ReconstructionROI* pROI);
143 virtual wxThread::ExitCode Entry(); // thread execution starts here
145 virtual void OnExit();
148 #endif // HAVE_WXTHREADS
149 #endif // _THREADRECON_H_