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.12 2001/03/05 19:14:40 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;
47 class ReconstructorSupervisorThread : public SupervisorThread {
49 ProjectionFileView* m_pProjView;
50 ImageFile* m_pImageFile;
53 const std::string m_strFilterName;
54 const double m_dFilterParam;
55 const std::string m_strFilterMethod;
57 const std::string m_strFilterGenerationName;
58 const std::string m_strInterpName;
59 const int m_iInterpParam;
60 const std::string m_strBackprojectName;
61 const std::string m_strLabel;
64 ReconstructorSupervisorThread(ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName,
65 double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName,
66 const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel);
68 virtual wxThread::ExitCode Entry();
70 virtual void OnExit();
75 class ReconstructorSupervisor : public BackgroundSupervisor {
78 std::vector<ImageFile*> m_vecpChildImageFile;
79 ProjectionFileView* m_pProjView;
80 ProjectionFileDocument* m_pProjDoc;
85 const char* const m_pszFilterName;
86 const double m_dFilterParam;
87 const char* const m_pszFilterMethod;
89 const char* const m_pszFilterGenerationName;
90 const char* const m_pszInterpName;
91 const int m_iInterpParam;
92 const char* const m_pszBackprojectName;
93 const char* const m_pszLabel;
96 ReconstructorSupervisor (SupervisorThread* pMyThread, ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName,
97 double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName,
98 const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel);
100 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
102 virtual ~ReconstructorSupervisor ();
106 ImageFile* getImageFile();
113 class ReconstructorWorker : public BackgroundWorkerThread {
115 ProjectionFileView* m_pProjView;
116 ImageFile* m_pImageFile;
117 const char* m_pszFilterName;
118 double m_dFilterParam;
119 const char* m_pszFilterMethod;
121 const char* m_pszFilterGenerationName;
122 const char* m_pszInterpName;
124 const char* m_pszBackprojectName;
127 ReconstructorWorker (ReconstructorSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
128 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
131 void SetParameters (ProjectionFileView* pProjFile, ImageFile* pImageFile,
132 const char* const pszFilterName, double dFilterParam, const char* const pszFilterMethod,
133 int iZeropad, const char* const pszFilterGenerationName, const char* const pszInterpName, int iInterpParam,
134 const char* pszBackprojectName);
136 virtual wxThread::ExitCode Entry(); // thread execution starts here
138 virtual void OnExit();
141 #endif // HAVE_WXTHREADS
142 #endif // _THREADRECON_H_