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-2001 Kevin Rosenberg
12 ** $Id: dialogs.h,v 1.24 2001/02/11 04:56:38 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"
39 #include "projections.h"
42 // CLASS StringValueAndTitleListBox
44 // A superclass of wxListBox that can handle string values and titles
45 // and by displaying the title in the list box and returning the string value
47 class StringValueAndTitleListBox : public wxListBox
50 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
52 const char* getSelectionStringValue () const;
55 const char** m_ppszValues;
59 class DialogGetPhantom : public wxDialog
62 DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
63 virtual ~DialogGetPhantom () {}
65 const char* getPhantom ();
68 StringValueAndTitleListBox* m_pListBoxPhantom;
73 class ImageFileDocument;
74 class DialogGetComparisonImage : public wxDialog
77 DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
78 virtual ~DialogGetComparisonImage () {}
80 ImageFileDocument* getImageFileDocument ();
82 bool getMakeDifferenceImage();
85 wxListBox* m_pListBoxImageChoices;
86 wxCheckBox* m_pMakeDifferenceImage;
87 const std::vector<ImageFileDocument*>& m_rVecIF;
92 class DialogGetMinMax : public wxDialog
95 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
96 virtual ~DialogGetMinMax ();
102 wxTextCtrl* m_pTextCtrlMin;
103 wxTextCtrl* m_pTextCtrlMax;
105 double m_dDefaultMin;
106 double m_dDefaultMax;
110 class DialogGetRasterParameters : public wxDialog
113 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
114 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
115 virtual ~DialogGetRasterParameters ();
117 unsigned int getXSize ();
118 unsigned int getYSize ();
119 unsigned int getNSamples ();
120 double getViewRatio();
123 wxTextCtrl* m_pTextCtrlXSize;
124 wxTextCtrl* m_pTextCtrlYSize;
125 wxTextCtrl* m_pTextCtrlNSamples;
126 wxTextCtrl* m_pTextCtrlViewRatio;
130 int m_iDefaultNSamples;
131 double m_dDefaultViewRatio;
135 class DialogGetProjectionParameters : public wxDialog
138 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
139 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
140 double dDefaultFocalLength = 1, double dDefaultViewRatio = 1.,
141 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
142 ~DialogGetProjectionParameters ();
144 unsigned int getNDet ();
145 unsigned int getNView ();
146 unsigned int getNSamples ();
149 double getRotAngle ();
150 double getViewRatio ();
151 double getScanRatio ();
152 double getFocalLengthRatio ();
153 const char* getGeometry();
156 wxTextCtrl* m_pTextCtrlNDet;
157 wxTextCtrl* m_pTextCtrlNView;
158 wxTextCtrl* m_pTextCtrlNSamples;
159 wxTextCtrl* m_pTextCtrlRotAngle;
160 wxTextCtrl* m_pTextCtrlFocalLength;
161 wxTextCtrl* m_pTextCtrlViewRatio;
162 wxTextCtrl* m_pTextCtrlScanRatio;
163 StringValueAndTitleListBox* m_pListBoxGeometry;
164 StringValueAndTitleListBox* m_pListBoxTrace;
168 int m_iDefaultNSamples;
170 int m_iDefaultGeometry;
171 double m_dDefaultRotAngle;
172 double m_dDefaultFocalLength;
173 double m_dDefaultViewRatio;
174 double m_dDefaultScanRatio;
178 #include "backprojectors.h"
179 class DialogGetReconstructionParameters : public wxDialog
182 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
183 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
184 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
185 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
186 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
187 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
188 int iDefaultTrace = Trace::TRACE_NONE);
189 virtual ~DialogGetReconstructionParameters ();
191 unsigned int getXSize();
192 unsigned int getYSize();
193 const char* getFilterName();
194 double getFilterParam();
195 const char* getFilterMethodName();
196 unsigned int getZeropad();
197 const char* getFilterGenerationName();
198 const char* getInterpName();
199 unsigned int getInterpParam();
200 const char* getBackprojectName();
204 wxTextCtrl* m_pTextCtrlXSize;
205 wxTextCtrl* m_pTextCtrlYSize;
206 wxTextCtrl* m_pTextCtrlZeropad;
207 wxTextCtrl* m_pTextCtrlFilterParam;
208 wxTextCtrl* m_pTextCtrlInterpParam;
210 StringValueAndTitleListBox* m_pListBoxFilter;
211 StringValueAndTitleListBox* m_pListBoxFilterMethod;
212 StringValueAndTitleListBox* m_pListBoxFilterGeneration;
213 StringValueAndTitleListBox* m_pListBoxInterp;
214 StringValueAndTitleListBox* m_pListBoxBackproject;
215 StringValueAndTitleListBox* m_pListBoxTrace;
219 double m_dDefaultFilterParam;
220 int m_iDefaultZeropad;
221 int m_iDefaultInterpParam;
226 class DialogGetFilterParameters : public wxDialog
229 DialogGetFilterParameters (wxWindow* 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.);
230 virtual ~DialogGetFilterParameters ();
232 unsigned int getXSize();
233 unsigned int getYSize();
234 const char* getFilterName();
235 const char* getDomainName();
236 double getFilterParam();
237 double getInputScale();
238 double getOutputScale();
239 double getBandwidth();
242 wxTextCtrl* m_pTextCtrlXSize;
243 wxTextCtrl* m_pTextCtrlYSize;
244 wxTextCtrl* m_pTextCtrlFilterParam;
245 wxTextCtrl* m_pTextCtrlOutputScale;
246 wxTextCtrl* m_pTextCtrlInputScale;
247 wxTextCtrl* m_pTextCtrlBandwidth;
249 StringValueAndTitleListBox* m_pListBoxFilter;
250 StringValueAndTitleListBox* m_pListBoxDomain;
254 double m_dDefaultFilterParam;
255 double m_dDefaultBandwidth;
256 double m_dDefaultOutputScale;
257 double m_dDefaultInputScale;
258 int m_iDefaultDomain;
261 class DialogExportParameters : public wxDialog
264 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
265 virtual ~DialogExportParameters () {}
267 const char* getFormatName();
270 StringValueAndTitleListBox* m_pListBoxFormat;
273 class DialogAutoScaleParameters : public wxDialog
276 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
277 virtual ~DialogAutoScaleParameters() {}
279 bool getMinMax (double* pMin, double* pMax);
280 double getAutoScaleFactor ();
283 const double m_dMean;
284 const double m_dMode;
285 const double m_dMedian;
286 const double m_dStdDev;
288 wxTextCtrl* m_pTextCtrlStdDevFactor;
289 wxListBox* m_pListBoxCenter;
292 class DialogGetXYSize : public wxDialog
295 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
296 virtual ~DialogGetXYSize ();
298 unsigned int getXSize ();
299 unsigned int getYSize ();
302 wxTextCtrl* m_pTextCtrlXSize;
303 wxTextCtrl* m_pTextCtrlYSize;
305 unsigned int m_iDefaultXSize;
306 unsigned int m_iDefaultYSize;
310 class DialogGetConvertPolarParameters : public wxDialog
313 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
314 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
315 int iDefaultZeropad = 1);
316 virtual ~DialogGetConvertPolarParameters ();
318 unsigned int getXSize();
319 unsigned int getYSize();
320 const char* getInterpolationName();
321 unsigned int getZeropad();
324 wxTextCtrl* m_pTextCtrlXSize;
325 wxTextCtrl* m_pTextCtrlYSize;
326 wxTextCtrl* m_pTextCtrlZeropad;
328 StringValueAndTitleListBox* m_pListBoxInterpolation;
332 int m_iDefaultZeropad;