1 /*****************************************************************************
5 ** Purpose: Header file for Dialogs of CTSim program
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: July 2000
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2000 Kevin Rosenberg
12 ** $Id: dialogs.h,v 1.18 2001/01/02 05:34:57 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 ******************************************************************************/
34 #include "ctsupport.h"
37 #include "procsignal.h"
41 // CLASS StringValueAndTitleListBox
43 // A superclass of wxListBox that can handle string values and titles
44 // and by displaying the title in the list box and returning the string value
46 class StringValueAndTitleListBox : public wxListBox
49 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
51 const char* getSelectionStringValue () const;
54 const char** m_ppszValues;
58 class DialogGetPhantom : public wxDialog
61 DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
62 virtual ~DialogGetPhantom () {}
64 const char* getPhantom ();
67 StringValueAndTitleListBox* m_pListBoxPhantom;
72 class ImageFileDocument;
\r
73 class DialogGetComparisonImage : public wxDialog
\r
76 DialogGetComparisonImage (wxFrame* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
\r
77 virtual ~DialogGetComparisonImage () {}
\r
79 ImageFileDocument* getImageFileDocument ();
\r
81 bool getMakeDifferenceImage();
\r
84 wxListBox* m_pListBoxImageChoices;
\r
85 wxCheckBox* m_pMakeDifferenceImage;
\r
86 const std::vector<ImageFileDocument*>& m_rVecIF;
\r
91 class DialogGetMinMax : public wxDialog
94 DialogGetMinMax (wxFrame* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
95 virtual ~DialogGetMinMax ();
101 wxTextCtrl* m_pTextCtrlMin;
102 wxTextCtrl* m_pTextCtrlMax;
104 double m_dDefaultMin;
105 double m_dDefaultMax;
109 class DialogGetRasterParameters : public wxDialog
112 DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1);
113 virtual ~DialogGetRasterParameters ();
115 unsigned int getXSize ();
116 unsigned int getYSize ();
117 unsigned int getNSamples ();
120 wxTextCtrl* m_pTextCtrlXSize;
121 wxTextCtrl* m_pTextCtrlYSize;
122 wxTextCtrl* m_pTextCtrlNSamples;
126 int m_iDefaultNSamples;
130 class DialogGetProjectionParameters : public wxDialog
133 DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet = 0, int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1., double dDefaultFocalLength = 1, double dDefaultFieldOfView = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
134 ~DialogGetProjectionParameters ();
136 unsigned int getNDet ();
137 unsigned int getNView ();
138 unsigned int getNSamples ();
141 double getRotAngle ();
142 double getFieldOfViewRatio ();
143 double getFocalLengthRatio ();
144 const char* getGeometry();
147 wxTextCtrl* m_pTextCtrlNDet;
148 wxTextCtrl* m_pTextCtrlNView;
149 wxTextCtrl* m_pTextCtrlNSamples;
150 wxTextCtrl* m_pTextCtrlRotAngle;
151 wxTextCtrl* m_pTextCtrlFocalLength;
152 wxTextCtrl* m_pTextCtrlFieldOfView;
154 StringValueAndTitleListBox* m_pListBoxGeometry;
155 StringValueAndTitleListBox* m_pListBoxTrace;
159 int m_iDefaultNSamples;
161 int m_iDefaultGeometry;
162 double m_dDefaultRotAngle;
163 double m_dDefaultFocalLength;
164 double m_dDefaultFieldOfView;
168 #include "backprojectors.h"
169 class DialogGetReconstructionParameters : public wxDialog
\r
172 DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1., int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION, int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_INVALID, int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR, int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF3, int iDefaultTrace = Trace::TRACE_NONE);
\r
173 virtual ~DialogGetReconstructionParameters ();
\r
175 unsigned int getXSize();
\r
176 unsigned int getYSize();
\r
177 const char* getFilterName();
\r
178 double getFilterParam();
\r
179 const char* getFilterMethodName();
\r
180 unsigned int getZeropad();
\r
181 const char* getFilterGenerationName();
\r
182 const char* getInterpName();
\r
183 unsigned int getInterpParam();
\r
184 const char* getBackprojectName();
\r
188 wxTextCtrl* m_pTextCtrlXSize;
\r
189 wxTextCtrl* m_pTextCtrlYSize;
\r
190 wxTextCtrl* m_pTextCtrlZeropad;
\r
191 wxTextCtrl* m_pTextCtrlFilterParam;
\r
192 wxTextCtrl* m_pTextCtrlInterpParam;
\r
194 StringValueAndTitleListBox* m_pListBoxFilter;
\r
195 StringValueAndTitleListBox* m_pListBoxFilterMethod;
\r
196 StringValueAndTitleListBox* m_pListBoxFilterGeneration;
\r
197 StringValueAndTitleListBox* m_pListBoxInterp;
\r
198 StringValueAndTitleListBox* m_pListBoxBackproject;
\r
199 StringValueAndTitleListBox* m_pListBoxTrace;
\r
201 int m_iDefaultXSize;
\r
202 int m_iDefaultYSize;
\r
203 double m_dDefaultFilterParam;
\r
204 int m_iDefaultZeropad;
\r
205 int m_iDefaultInterpParam;
\r
206 int m_iDefaultTrace;
\r
210 class DialogGetFilterParameters : public wxDialog
\r
213 DialogGetFilterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultFilterID = SignalFilter::FILTER_BANDLIMIT, double dDefaultFilterParam = 1., double dDefaultBandwidth = 1., int iDefaultDomain = SignalFilter::DOMAIN_SPATIAL, double dDefaultInputScale = 1., double dDefaultOutputScale = 1.);
\r
214 virtual ~DialogGetFilterParameters ();
\r
216 unsigned int getXSize();
\r
217 unsigned int getYSize();
\r
218 const char* getFilterName();
\r
219 const char* getDomainName();
\r
220 double getFilterParam();
\r
221 double getInputScale();
\r
222 double getOutputScale();
\r
223 double getBandwidth();
\r
226 wxTextCtrl* m_pTextCtrlXSize;
\r
227 wxTextCtrl* m_pTextCtrlYSize;
\r
228 wxTextCtrl* m_pTextCtrlFilterParam;
\r
229 wxTextCtrl* m_pTextCtrlOutputScale;
\r
230 wxTextCtrl* m_pTextCtrlInputScale;
\r
231 wxTextCtrl* m_pTextCtrlBandwidth;
\r
233 StringValueAndTitleListBox* m_pListBoxFilter;
\r
234 StringValueAndTitleListBox* m_pListBoxDomain;
\r
236 int m_iDefaultXSize;
\r
237 int m_iDefaultYSize;
\r
238 double m_dDefaultFilterParam;
\r
239 double m_dDefaultBandwidth;
\r
240 double m_dDefaultOutputScale;
\r
241 double m_dDefaultInputScale;
\r
242 int m_iDefaultDomain;
\r
245 class DialogExportParameters : public wxDialog
\r
248 DialogExportParameters (wxFrame* pParent, int iDefaultFormatID);
\r
249 virtual ~DialogExportParameters () {}
\r
251 const char* getFormatName();
\r
254 StringValueAndTitleListBox* m_pListBoxFormat;
\r
257 class DialogAutoScaleParameters : public wxDialog
260 DialogAutoScaleParameters (wxFrame* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
261 virtual ~DialogAutoScaleParameters() {}
263 bool getMinMax (double* pMin, double* pMax);
264 double getAutoScaleFactor ();
267 const double m_dMean;
\r
268 const double m_dMode;
269 const double m_dMedian;
\r
270 const double m_dStdDev;
\r
272 wxTextCtrl* m_pTextCtrlStdDevFactor;
273 wxListBox* m_pListBoxCenter;
276 class DialogGetXYSize : public wxDialog
\r
279 DialogGetXYSize (wxFrame* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
\r
280 virtual ~DialogGetXYSize ();
\r
282 unsigned int getXSize ();
\r
283 unsigned int getYSize ();
\r
286 wxTextCtrl* m_pTextCtrlXSize;
\r
287 wxTextCtrl* m_pTextCtrlYSize;
\r
289 unsigned int m_iDefaultXSize;
\r
290 unsigned int m_iDefaultYSize;
\r