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.28 2001/02/21 20:13:03 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 CTSimHelpButton : public wxButton
45 CTSimHelpButton (wxWindow* parent, int id)
46 : wxButton (parent, id, "Help")
51 // CLASS StringValueAndTitleListBox
53 // A superclass of wxListBox that can handle string values and titles
54 // and by displaying the title in the list box and returning the string value
56 class StringValueAndTitleListBox : public wxListBox
59 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
61 const char* getSelectionStringValue () const;
64 const char** m_ppszValues;
68 class StringValueAndTitleRadioBox : public wxRadioBox
71 StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* aszTitle[], const char* aszValue[]);
73 const char* getSelectionStringValue () const;
76 const char** m_ppszValues;
80 class DialogGetPhantom : public wxDialog
83 DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
84 virtual ~DialogGetPhantom () {}
86 const char* getPhantom ();
89 StringValueAndTitleRadioBox* m_pRadioBoxPhantom;
94 class ImageFileDocument;
95 class DialogGetComparisonImage : public wxDialog
98 DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
99 virtual ~DialogGetComparisonImage () {}
101 ImageFileDocument* getImageFileDocument ();
103 bool getMakeDifferenceImage();
106 wxListBox* m_pListBoxImageChoices;
107 wxCheckBox* m_pMakeDifferenceImage;
108 const std::vector<ImageFileDocument*>& m_rVecIF;
112 class DialogPreferences : public wxDialog
115 DialogPreferences (wxWindow* pParent, const char* const pszTitle, bool bAdvanced, bool bAskNewDocs,
116 bool bVerboseLogging);
117 virtual ~DialogPreferences ();
119 bool getAdvancedOptions ();
120 bool getAskDeleteNewDocs ();
121 bool getVerboseLogging ();
124 wxCheckBox* m_pCBAdvancedOptions;
125 wxCheckBox* m_pCBAskDeleteNewDocs;
126 wxCheckBox* m_pCBVerboseLogging;
131 class DialogGetMinMax : public wxDialog
134 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
135 virtual ~DialogGetMinMax ();
137 double getMinimum ();
138 double getMaximum ();
141 wxTextCtrl* m_pTextCtrlMin;
142 wxTextCtrl* m_pTextCtrlMax;
144 double m_dDefaultMin;
145 double m_dDefaultMax;
149 class DialogGetRasterParameters : public wxDialog
152 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
153 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
154 virtual ~DialogGetRasterParameters ();
156 unsigned int getXSize ();
157 unsigned int getYSize ();
158 unsigned int getNSamples ();
159 double getViewRatio();
162 wxTextCtrl* m_pTextCtrlXSize;
163 wxTextCtrl* m_pTextCtrlYSize;
164 wxTextCtrl* m_pTextCtrlNSamples;
165 wxTextCtrl* m_pTextCtrlViewRatio;
169 int m_iDefaultNSamples;
170 double m_dDefaultViewRatio;
174 class DialogGetProjectionParameters : public wxDialog
177 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
178 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
179 double dDefaultFocalLength = 1, double dDefaultViewRatio = 1.,
180 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
181 ~DialogGetProjectionParameters ();
183 unsigned int getNDet ();
184 unsigned int getNView ();
185 unsigned int getNSamples ();
188 double getRotAngle ();
189 double getViewRatio ();
190 double getScanRatio ();
191 double getFocalLengthRatio ();
192 const char* getGeometry();
195 wxTextCtrl* m_pTextCtrlNDet;
196 wxTextCtrl* m_pTextCtrlNView;
197 wxTextCtrl* m_pTextCtrlNSamples;
198 wxTextCtrl* m_pTextCtrlRotAngle;
199 wxTextCtrl* m_pTextCtrlFocalLength;
200 wxTextCtrl* m_pTextCtrlViewRatio;
201 wxTextCtrl* m_pTextCtrlScanRatio;
202 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
203 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
207 int m_iDefaultNSamples;
209 int m_iDefaultGeometry;
210 double m_dDefaultRotAngle;
211 double m_dDefaultFocalLength;
212 double m_dDefaultViewRatio;
213 double m_dDefaultScanRatio;
217 #include "backprojectors.h"
218 class DialogGetReconstructionParameters : public wxDialog
221 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
222 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
223 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
224 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
225 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
226 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
227 int iDefaultTrace = Trace::TRACE_NONE);
228 virtual ~DialogGetReconstructionParameters ();
230 unsigned int getXSize();
231 unsigned int getYSize();
232 const char* getFilterName();
233 double getFilterParam();
234 const char* getFilterMethodName();
235 unsigned int getZeropad();
236 const char* getFilterGenerationName();
237 const char* getInterpName();
238 unsigned int getInterpParam();
239 const char* getBackprojectName();
243 wxTextCtrl* m_pTextCtrlXSize;
244 wxTextCtrl* m_pTextCtrlYSize;
245 wxTextCtrl* m_pTextCtrlZeropad;
246 wxTextCtrl* m_pTextCtrlFilterParam;
247 wxTextCtrl* m_pTextCtrlInterpParam;
249 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
250 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
251 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
252 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
253 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
254 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
258 double m_dDefaultFilterParam;
259 int m_iDefaultZeropad;
260 int m_iDefaultInterpParam;
265 class DialogGetFilterParameters : public wxDialog
268 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.);
269 virtual ~DialogGetFilterParameters ();
271 unsigned int getXSize();
272 unsigned int getYSize();
273 const char* getFilterName();
274 const char* getDomainName();
275 double getFilterParam();
276 double getInputScale();
277 double getOutputScale();
278 double getBandwidth();
281 wxTextCtrl* m_pTextCtrlXSize;
282 wxTextCtrl* m_pTextCtrlYSize;
283 wxTextCtrl* m_pTextCtrlFilterParam;
284 wxTextCtrl* m_pTextCtrlOutputScale;
285 wxTextCtrl* m_pTextCtrlInputScale;
286 wxTextCtrl* m_pTextCtrlBandwidth;
288 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
289 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
293 double m_dDefaultFilterParam;
294 double m_dDefaultBandwidth;
295 double m_dDefaultOutputScale;
296 double m_dDefaultInputScale;
297 int m_iDefaultDomain;
300 class DialogExportParameters : public wxDialog
303 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
304 virtual ~DialogExportParameters () {}
306 const char* getFormatName();
309 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
312 class DialogAutoScaleParameters : public wxDialog
315 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
316 virtual ~DialogAutoScaleParameters() {}
318 bool getMinMax (double* pMin, double* pMax);
319 double getAutoScaleFactor ();
322 const double m_dMean;
323 const double m_dMode;
324 const double m_dMedian;
325 const double m_dStdDev;
327 wxTextCtrl* m_pTextCtrlStdDevFactor;
328 wxRadioBox* m_pRadioBoxCenter;
331 class DialogGetXYSize : public wxDialog
334 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
335 virtual ~DialogGetXYSize ();
337 unsigned int getXSize ();
338 unsigned int getYSize ();
341 wxTextCtrl* m_pTextCtrlXSize;
342 wxTextCtrl* m_pTextCtrlYSize;
344 unsigned int m_iDefaultXSize;
345 unsigned int m_iDefaultYSize;
349 class DialogGetConvertPolarParameters : public wxDialog
352 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
353 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
354 int iDefaultZeropad = 1);
355 virtual ~DialogGetConvertPolarParameters ();
357 unsigned int getXSize();
358 unsigned int getYSize();
359 const char* getInterpolationName();
360 unsigned int getZeropad();
363 wxTextCtrl* m_pTextCtrlXSize;
364 wxTextCtrl* m_pTextCtrlYSize;
365 wxTextCtrl* m_pTextCtrlZeropad;
367 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
371 int m_iDefaultZeropad;