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.23 2001/02/08 06:25:07 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, 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);
183 virtual ~DialogGetReconstructionParameters ();
185 unsigned int getXSize();
186 unsigned int getYSize();
187 const char* getFilterName();
188 double getFilterParam();
189 const char* getFilterMethodName();
190 unsigned int getZeropad();
191 const char* getFilterGenerationName();
192 const char* getInterpName();
193 unsigned int getInterpParam();
194 const char* getBackprojectName();
198 wxTextCtrl* m_pTextCtrlXSize;
199 wxTextCtrl* m_pTextCtrlYSize;
200 wxTextCtrl* m_pTextCtrlZeropad;
201 wxTextCtrl* m_pTextCtrlFilterParam;
202 wxTextCtrl* m_pTextCtrlInterpParam;
204 StringValueAndTitleListBox* m_pListBoxFilter;
205 StringValueAndTitleListBox* m_pListBoxFilterMethod;
206 StringValueAndTitleListBox* m_pListBoxFilterGeneration;
207 StringValueAndTitleListBox* m_pListBoxInterp;
208 StringValueAndTitleListBox* m_pListBoxBackproject;
209 StringValueAndTitleListBox* m_pListBoxTrace;
213 double m_dDefaultFilterParam;
214 int m_iDefaultZeropad;
215 int m_iDefaultInterpParam;
220 class DialogGetFilterParameters : public wxDialog
223 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.);
224 virtual ~DialogGetFilterParameters ();
226 unsigned int getXSize();
227 unsigned int getYSize();
228 const char* getFilterName();
229 const char* getDomainName();
230 double getFilterParam();
231 double getInputScale();
232 double getOutputScale();
233 double getBandwidth();
236 wxTextCtrl* m_pTextCtrlXSize;
237 wxTextCtrl* m_pTextCtrlYSize;
238 wxTextCtrl* m_pTextCtrlFilterParam;
239 wxTextCtrl* m_pTextCtrlOutputScale;
240 wxTextCtrl* m_pTextCtrlInputScale;
241 wxTextCtrl* m_pTextCtrlBandwidth;
243 StringValueAndTitleListBox* m_pListBoxFilter;
244 StringValueAndTitleListBox* m_pListBoxDomain;
248 double m_dDefaultFilterParam;
249 double m_dDefaultBandwidth;
250 double m_dDefaultOutputScale;
251 double m_dDefaultInputScale;
252 int m_iDefaultDomain;
255 class DialogExportParameters : public wxDialog
258 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
259 virtual ~DialogExportParameters () {}
261 const char* getFormatName();
264 StringValueAndTitleListBox* m_pListBoxFormat;
267 class DialogAutoScaleParameters : public wxDialog
270 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
271 virtual ~DialogAutoScaleParameters() {}
273 bool getMinMax (double* pMin, double* pMax);
274 double getAutoScaleFactor ();
277 const double m_dMean;
278 const double m_dMode;
279 const double m_dMedian;
280 const double m_dStdDev;
282 wxTextCtrl* m_pTextCtrlStdDevFactor;
283 wxListBox* m_pListBoxCenter;
286 class DialogGetXYSize : public wxDialog
289 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
290 virtual ~DialogGetXYSize ();
292 unsigned int getXSize ();
293 unsigned int getYSize ();
296 wxTextCtrl* m_pTextCtrlXSize;
297 wxTextCtrl* m_pTextCtrlYSize;
299 unsigned int m_iDefaultXSize;
300 unsigned int m_iDefaultYSize;
304 class DialogGetConvertPolarParameters : public wxDialog
307 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
308 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
309 int iDefaultZeropad = 1);
310 virtual ~DialogGetConvertPolarParameters ();
312 unsigned int getXSize();
313 unsigned int getYSize();
314 const char* getInterpolationName();
315 unsigned int getZeropad();
318 wxTextCtrl* m_pTextCtrlXSize;
319 wxTextCtrl* m_pTextCtrlYSize;
320 wxTextCtrl* m_pTextCtrlZeropad;
322 StringValueAndTitleListBox* m_pListBoxInterpolation;
326 int m_iDefaultZeropad;