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.10 2001/02/25 19:24:01 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
32 #include <wx/thread.h>
33 #include <wx/progdlg.h>
35 #include "backgroundsupr.h"
40 class ProjectionFileDocument;
41 class ReconstructorWorker;
42 class ProjectionFileView;
44 class ReconstructorSupervisorThread : public SupervisorThread {
46 ProjectionFileView* m_pProjView;
47 ImageFile* m_pImageFile;
50 const std::string m_strFilterName;
51 const double m_dFilterParam;
52 const std::string m_strFilterMethod;
54 const std::string m_strFilterGenerationName;
55 const std::string m_strInterpName;
56 const int m_iInterpParam;
57 const std::string m_strBackprojectName;
58 const std::string m_strLabel;
61 ReconstructorSupervisorThread(ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName,
62 double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName,
63 const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel);
65 virtual wxThread::ExitCode Entry();
67 virtual void OnExit();
72 class ReconstructorSupervisor : public BackgroundSupervisor {
75 std::vector<ImageFile*> m_vecpChildImageFile;
76 ProjectionFileDocument* m_pProjDoc;
77 ProjectionFileView* m_pProjView;
82 const char* const m_pszFilterName;
83 const double m_dFilterParam;
84 const char* const m_pszFilterMethod;
86 const char* const m_pszFilterGenerationName;
87 const char* const m_pszInterpName;
88 const int m_iInterpParam;
89 const char* const m_pszBackprojectName;
90 const char* const m_pszLabel;
93 ReconstructorSupervisor (SupervisorThread* pMyThread, ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName,
94 double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName,
95 const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel);
97 virtual BackgroundWorkerThread* createWorker (int iThread, int iStartUnit, int iNumUnits);
99 virtual ~ReconstructorSupervisor ();
103 ImageFile* getImageFile();
110 class ReconstructorWorker : public BackgroundWorkerThread {
112 ProjectionFileView* m_pProjView;
113 ImageFile* m_pImageFile;
114 const char* m_pszFilterName;
115 double m_dFilterParam;
116 const char* m_pszFilterMethod;
118 const char* m_pszFilterGenerationName;
119 const char* m_pszInterpName;
121 const char* m_pszBackprojectName;
124 ReconstructorWorker (ReconstructorSupervisor* pSupervisor, int iThread, int iStartView, int iNumViews)
125 : BackgroundWorkerThread (pSupervisor, iThread, iStartView, iNumViews)
128 void SetParameters (ProjectionFileView* pProjFile, ImageFile* pImageFile,
129 const char* const pszFilterName, double dFilterParam, const char* const pszFilterMethod,
130 int iZeropad, const char* const pszFilterGenerationName, const char* const pszInterpName, int iInterpParam,
131 const char* pszBackprojectName);
133 virtual wxThread::ExitCode Entry(); // thread execution starts here
135 virtual void OnExit();