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.26 2001/02/14 18:39:47 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 StringValueAndTitleRadioBox : public wxRadioBox
62 StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* aszTitle[], const char* aszValue[]);
64 const char* getSelectionStringValue () const;
67 const char** m_ppszValues;
71 class DialogGetPhantom : public wxDialog
74 DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
75 virtual ~DialogGetPhantom () {}
77 const char* getPhantom ();
80 StringValueAndTitleRadioBox* m_pRadioBoxPhantom;
85 class ImageFileDocument;
86 class DialogGetComparisonImage : public wxDialog
89 DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
90 virtual ~DialogGetComparisonImage () {}
92 ImageFileDocument* getImageFileDocument ();
94 bool getMakeDifferenceImage();
97 wxListBox* m_pListBoxImageChoices;
98 wxCheckBox* m_pMakeDifferenceImage;
99 const std::vector<ImageFileDocument*>& m_rVecIF;
103 class DialogPreferences : public wxDialog
106 DialogPreferences (wxWindow* pParent, const char* const pszTitle, bool bAdvanced, bool bAskNewDocs);
107 virtual ~DialogPreferences ();
109 bool getAdvancedOptions ();
110 bool getAskDeleteNewDocs ();
113 wxCheckBox* m_pCBAdvancedOptions;
114 wxCheckBox* m_pCBAskDeleteNewDocs;
119 class DialogGetMinMax : public wxDialog
122 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
123 virtual ~DialogGetMinMax ();
125 double getMinimum ();
126 double getMaximum ();
129 wxTextCtrl* m_pTextCtrlMin;
130 wxTextCtrl* m_pTextCtrlMax;
132 double m_dDefaultMin;
133 double m_dDefaultMax;
137 class DialogGetRasterParameters : public wxDialog
140 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
141 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
142 virtual ~DialogGetRasterParameters ();
144 unsigned int getXSize ();
145 unsigned int getYSize ();
146 unsigned int getNSamples ();
147 double getViewRatio();
150 wxTextCtrl* m_pTextCtrlXSize;
151 wxTextCtrl* m_pTextCtrlYSize;
152 wxTextCtrl* m_pTextCtrlNSamples;
153 wxTextCtrl* m_pTextCtrlViewRatio;
157 int m_iDefaultNSamples;
158 double m_dDefaultViewRatio;
162 class DialogGetProjectionParameters : public wxDialog
165 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
166 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
167 double dDefaultFocalLength = 1, double dDefaultViewRatio = 1.,
168 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
169 ~DialogGetProjectionParameters ();
171 unsigned int getNDet ();
172 unsigned int getNView ();
173 unsigned int getNSamples ();
176 double getRotAngle ();
177 double getViewRatio ();
178 double getScanRatio ();
179 double getFocalLengthRatio ();
180 const char* getGeometry();
183 wxTextCtrl* m_pTextCtrlNDet;
184 wxTextCtrl* m_pTextCtrlNView;
185 wxTextCtrl* m_pTextCtrlNSamples;
186 wxTextCtrl* m_pTextCtrlRotAngle;
187 wxTextCtrl* m_pTextCtrlFocalLength;
188 wxTextCtrl* m_pTextCtrlViewRatio;
189 wxTextCtrl* m_pTextCtrlScanRatio;
190 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
191 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
195 int m_iDefaultNSamples;
197 int m_iDefaultGeometry;
198 double m_dDefaultRotAngle;
199 double m_dDefaultFocalLength;
200 double m_dDefaultViewRatio;
201 double m_dDefaultScanRatio;
205 #include "backprojectors.h"
206 class DialogGetReconstructionParameters : public wxDialog
209 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
210 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
211 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
212 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
213 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
214 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
215 int iDefaultTrace = Trace::TRACE_NONE);
216 virtual ~DialogGetReconstructionParameters ();
218 unsigned int getXSize();
219 unsigned int getYSize();
220 const char* getFilterName();
221 double getFilterParam();
222 const char* getFilterMethodName();
223 unsigned int getZeropad();
224 const char* getFilterGenerationName();
225 const char* getInterpName();
226 unsigned int getInterpParam();
227 const char* getBackprojectName();
231 wxTextCtrl* m_pTextCtrlXSize;
232 wxTextCtrl* m_pTextCtrlYSize;
233 wxTextCtrl* m_pTextCtrlZeropad;
234 wxTextCtrl* m_pTextCtrlFilterParam;
235 wxTextCtrl* m_pTextCtrlInterpParam;
237 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
238 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
239 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
240 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
241 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
242 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
246 double m_dDefaultFilterParam;
247 int m_iDefaultZeropad;
248 int m_iDefaultInterpParam;
253 class DialogGetFilterParameters : public wxDialog
256 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.);
257 virtual ~DialogGetFilterParameters ();
259 unsigned int getXSize();
260 unsigned int getYSize();
261 const char* getFilterName();
262 const char* getDomainName();
263 double getFilterParam();
264 double getInputScale();
265 double getOutputScale();
266 double getBandwidth();
269 wxTextCtrl* m_pTextCtrlXSize;
270 wxTextCtrl* m_pTextCtrlYSize;
271 wxTextCtrl* m_pTextCtrlFilterParam;
272 wxTextCtrl* m_pTextCtrlOutputScale;
273 wxTextCtrl* m_pTextCtrlInputScale;
274 wxTextCtrl* m_pTextCtrlBandwidth;
276 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
277 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
281 double m_dDefaultFilterParam;
282 double m_dDefaultBandwidth;
283 double m_dDefaultOutputScale;
284 double m_dDefaultInputScale;
285 int m_iDefaultDomain;
288 class DialogExportParameters : public wxDialog
291 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
292 virtual ~DialogExportParameters () {}
294 const char* getFormatName();
297 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
300 class DialogAutoScaleParameters : public wxDialog
303 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
304 virtual ~DialogAutoScaleParameters() {}
306 bool getMinMax (double* pMin, double* pMax);
307 double getAutoScaleFactor ();
310 const double m_dMean;
311 const double m_dMode;
312 const double m_dMedian;
313 const double m_dStdDev;
315 wxTextCtrl* m_pTextCtrlStdDevFactor;
316 wxRadioBox* m_pRadioBoxCenter;
319 class DialogGetXYSize : public wxDialog
322 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
323 virtual ~DialogGetXYSize ();
325 unsigned int getXSize ();
326 unsigned int getYSize ();
329 wxTextCtrl* m_pTextCtrlXSize;
330 wxTextCtrl* m_pTextCtrlYSize;
332 unsigned int m_iDefaultXSize;
333 unsigned int m_iDefaultYSize;
337 class DialogGetConvertPolarParameters : public wxDialog
340 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
341 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
342 int iDefaultZeropad = 1);
343 virtual ~DialogGetConvertPolarParameters ();
345 unsigned int getXSize();
346 unsigned int getYSize();
347 const char* getInterpolationName();
348 unsigned int getZeropad();
351 wxTextCtrl* m_pTextCtrlXSize;
352 wxTextCtrl* m_pTextCtrlYSize;
353 wxTextCtrl* m_pTextCtrlZeropad;
355 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
359 int m_iDefaultZeropad;