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.22 2001/01/28 19:10:18 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, int iDefaultNSamples = 1);
114 virtual ~DialogGetRasterParameters ();
116 unsigned int getXSize ();
117 unsigned int getYSize ();
118 unsigned int getNSamples ();
121 wxTextCtrl* m_pTextCtrlXSize;
122 wxTextCtrl* m_pTextCtrlYSize;
123 wxTextCtrl* m_pTextCtrlNSamples;
127 int m_iDefaultNSamples;
131 class DialogGetProjectionParameters : public wxDialog
134 DialogGetProjectionParameters (wxWindow* 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);
135 ~DialogGetProjectionParameters ();
137 unsigned int getNDet ();
138 unsigned int getNView ();
139 unsigned int getNSamples ();
142 double getRotAngle ();
143 double getFieldOfViewRatio ();
144 double getFocalLengthRatio ();
145 const char* getGeometry();
148 wxTextCtrl* m_pTextCtrlNDet;
149 wxTextCtrl* m_pTextCtrlNView;
150 wxTextCtrl* m_pTextCtrlNSamples;
151 wxTextCtrl* m_pTextCtrlRotAngle;
152 wxTextCtrl* m_pTextCtrlFocalLength;
153 wxTextCtrl* m_pTextCtrlFieldOfView;
155 StringValueAndTitleListBox* m_pListBoxGeometry;
156 StringValueAndTitleListBox* m_pListBoxTrace;
160 int m_iDefaultNSamples;
162 int m_iDefaultGeometry;
163 double m_dDefaultRotAngle;
164 double m_dDefaultFocalLength;
165 double m_dDefaultFieldOfView;
169 #include "backprojectors.h"
170 class DialogGetReconstructionParameters : public wxDialog
173 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);
174 virtual ~DialogGetReconstructionParameters ();
176 unsigned int getXSize();
177 unsigned int getYSize();
178 const char* getFilterName();
179 double getFilterParam();
180 const char* getFilterMethodName();
181 unsigned int getZeropad();
182 const char* getFilterGenerationName();
183 const char* getInterpName();
184 unsigned int getInterpParam();
185 const char* getBackprojectName();
189 wxTextCtrl* m_pTextCtrlXSize;
190 wxTextCtrl* m_pTextCtrlYSize;
191 wxTextCtrl* m_pTextCtrlZeropad;
192 wxTextCtrl* m_pTextCtrlFilterParam;
193 wxTextCtrl* m_pTextCtrlInterpParam;
195 StringValueAndTitleListBox* m_pListBoxFilter;
196 StringValueAndTitleListBox* m_pListBoxFilterMethod;
197 StringValueAndTitleListBox* m_pListBoxFilterGeneration;
198 StringValueAndTitleListBox* m_pListBoxInterp;
199 StringValueAndTitleListBox* m_pListBoxBackproject;
200 StringValueAndTitleListBox* m_pListBoxTrace;
204 double m_dDefaultFilterParam;
205 int m_iDefaultZeropad;
206 int m_iDefaultInterpParam;
211 class DialogGetFilterParameters : public wxDialog
214 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.);
215 virtual ~DialogGetFilterParameters ();
217 unsigned int getXSize();
218 unsigned int getYSize();
219 const char* getFilterName();
220 const char* getDomainName();
221 double getFilterParam();
222 double getInputScale();
223 double getOutputScale();
224 double getBandwidth();
227 wxTextCtrl* m_pTextCtrlXSize;
228 wxTextCtrl* m_pTextCtrlYSize;
229 wxTextCtrl* m_pTextCtrlFilterParam;
230 wxTextCtrl* m_pTextCtrlOutputScale;
231 wxTextCtrl* m_pTextCtrlInputScale;
232 wxTextCtrl* m_pTextCtrlBandwidth;
234 StringValueAndTitleListBox* m_pListBoxFilter;
235 StringValueAndTitleListBox* m_pListBoxDomain;
239 double m_dDefaultFilterParam;
240 double m_dDefaultBandwidth;
241 double m_dDefaultOutputScale;
242 double m_dDefaultInputScale;
243 int m_iDefaultDomain;
246 class DialogExportParameters : public wxDialog
249 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
250 virtual ~DialogExportParameters () {}
252 const char* getFormatName();
255 StringValueAndTitleListBox* m_pListBoxFormat;
258 class DialogAutoScaleParameters : public wxDialog
261 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
262 virtual ~DialogAutoScaleParameters() {}
264 bool getMinMax (double* pMin, double* pMax);
265 double getAutoScaleFactor ();
268 const double m_dMean;
269 const double m_dMode;
270 const double m_dMedian;
271 const double m_dStdDev;
273 wxTextCtrl* m_pTextCtrlStdDevFactor;
274 wxListBox* m_pListBoxCenter;
277 class DialogGetXYSize : public wxDialog
280 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
281 virtual ~DialogGetXYSize ();
283 unsigned int getXSize ();
284 unsigned int getYSize ();
287 wxTextCtrl* m_pTextCtrlXSize;
288 wxTextCtrl* m_pTextCtrlYSize;
290 unsigned int m_iDefaultXSize;
291 unsigned int m_iDefaultYSize;
295 class DialogGetConvertPolarParameters : public wxDialog
298 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
299 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
300 int iDefaultZeropad = 1);
301 virtual ~DialogGetConvertPolarParameters ();
303 unsigned int getXSize();
304 unsigned int getYSize();
305 const char* getInterpolationName();
306 unsigned int getZeropad();
309 wxTextCtrl* m_pTextCtrlXSize;
310 wxTextCtrl* m_pTextCtrlYSize;
311 wxTextCtrl* m_pTextCtrlZeropad;
313 StringValueAndTitleListBox* m_pListBoxInterpolation;
317 int m_iDefaultZeropad;