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: threadrecon.h,v 1.13 2001/03/11 15:27:30 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 ******************************************************************************/
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 std::string m_strLabel;
63 ReconstructionROI m_reconROI;
66 ReconstructorSupervisorThread(ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName,
67 double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName,
68 const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel,
69 ReconstructionROI* pROI);
71 virtual wxThread::ExitCode Entry();
73 virtual void OnExit();
78 class ReconstructorSupervisor : public BackgroundSupervisor {
81 std::vector<ImageFile*> m_vecpChildImageFile;
82 ProjectionFileView* m_pProjView;
83 ProjectionFileDocument* m_pProjDoc;
88 const char* const m_pszFilterName;
89 const double m_dFilterParam;
90 const char* const m_pszFilterMethod;
92 const char* const m_pszFilterGenerationName;
93 const char* const m_pszInterpName;
94 const int m_iInterpParam;
95 const char* const m_pszBackprojectName;
96 const char* const m_pszLabel;
97 ReconstructionROI* m_pReconROI;
100 ReconstructorSupervisor (SupervisorThread* pMyThread, ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName,
101 double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName,
102 const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel,
103 ReconstructionROI* pReconROI);
105 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
107 virtual ~ReconstructorSupervisor ();
111 ImageFile* getImageFile();
118 class ReconstructorWorker : public BackgroundWorkerThread {
120 ProjectionFileView* m_pProjView;
121 ImageFile* m_pImageFile;
122 const char* m_pszFilterName;
123 double m_dFilterParam;
124 const char* m_pszFilterMethod;
126 const char* m_pszFilterGenerationName;
127 const char* m_pszInterpName;
129 const char* m_pszBackprojectName;
130 ReconstructionROI* m_pReconROI;
133 ReconstructorWorker (ReconstructorSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
134 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
137 void SetParameters (ProjectionFileView* pProjFile, ImageFile* pImageFile,
138 const char* const pszFilterName, double dFilterParam, const char* const pszFilterMethod,
139 int iZeropad, const char* const pszFilterGenerationName, const char* const pszInterpName, int iInterpParam,
140 const char* pszBackprojectName, ReconstructionROI* pROI);
142 virtual wxThread::ExitCode Entry(); // thread execution starts here
144 virtual void OnExit();
147 #endif // HAVE_WXTHREADS
148 #endif // _THREADRECON_H_