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-2009 Kevin Rosenberg
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License (version 2) as
14 ** published by the Free Software Foundation.
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ** GNU General Public License for more details.
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ******************************************************************************/
32 #include "ctsupport.h"
35 #include "procsignal.h"
37 #include "projections.h"
38 #include "ctsim-map.h"
41 class CTSimHelpButton : public wxButton
44 CTSimHelpButton (wxWindow* parent, int id)
45 : wxButton (parent, id, _T("Help"))
50 // CLASS StringValueAndTitleListBox
52 // A superclass of wxListBox that can handle string values and titles
53 // and by displaying the title in the list box and returning the string value
55 class StringValueAndTitleListBox : public wxListBox
58 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, wxChar const* const* asTitle,
59 char const* const aszValue[]);
61 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, wxChar const* title,
62 char const* const* aszTitle, char const* const* aszValue);
64 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, wxChar const* title,
65 wxChar const* const* asTitle, char const* const* aszValue);
67 const char* getSelectionStringValue () const;
70 const char* const* m_ppszValues;
74 class StringValueAndTitleRadioBox : public wxRadioBox
77 StringValueAndTitleRadioBox (wxDialog* pParent, wxChar const* strTitle, int nChoices, const char* const aszTitle[], const char* const aszValue[]);
79 const char* getSelectionStringValue () const;
82 const char* const* m_ppszValues;
86 class DialogGetPhantom : public wxDialog
89 DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
90 virtual ~DialogGetPhantom () {}
92 const char* getPhantom ();
95 StringValueAndTitleRadioBox* m_pRadioBoxPhantom;
98 class DialogGetThetaRange : public wxDialog
101 DialogGetThetaRange (wxWindow* pParent, int iDefaultThetaRange = ParallelRaysums::THETA_RANGE_UNCONSTRAINED);
102 virtual ~DialogGetThetaRange () {}
104 int getThetaRange ();
107 wxRadioBox* m_pRadioBoxThetaRange;
112 class ImageFileDocument;
113 class DialogGetComparisonImage : public wxDialog
116 DialogGetComparisonImage (wxWindow* pParent, wxChar const * pwszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
117 virtual ~DialogGetComparisonImage () {}
119 ImageFileDocument* getImageFileDocument ();
121 bool getMakeDifferenceImage();
124 wxListBox* m_pListBoxImageChoices;
125 wxCheckBox* m_pMakeDifferenceImage;
126 const std::vector<ImageFileDocument*>& m_rVecIF;
130 class DialogPreferences : public wxDialog
133 DialogPreferences (wxWindow* pParent, wxChar const* pszTitle, bool bAdvanced, bool bAskNewDocs,
134 bool bVerboseLogging, bool bStartupTips, bool bUseBackgroundTasks);
135 virtual ~DialogPreferences ();
137 bool getAdvancedOptions ();
138 bool getAskDeleteNewDocs ();
139 bool getVerboseLogging ();
140 bool getStartupTips ();
141 bool getUseBackgroundTasks();
144 wxCheckBox* m_pCBAdvancedOptions;
145 wxCheckBox* m_pCBAskDeleteNewDocs;
146 wxCheckBox* m_pCBVerboseLogging;
147 wxCheckBox* m_pCBStartupTips;
148 wxCheckBox* m_pCBUseBackgroundTasks;
153 class DialogGetMinMax : public wxDialog
156 DialogGetMinMax (wxWindow* pParent, wxChar const* pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
157 virtual ~DialogGetMinMax ();
159 double getMinimum ();
160 double getMaximum ();
163 wxTextCtrl* m_pTextCtrlMin;
164 wxTextCtrl* m_pTextCtrlMax;
166 double m_dDefaultMin;
167 double m_dDefaultMax;
171 class DialogGetRasterParameters : public wxDialog
174 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
175 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
176 virtual ~DialogGetRasterParameters ();
178 unsigned int getXSize ();
179 unsigned int getYSize ();
180 unsigned int getNSamples ();
181 double getViewRatio();
184 wxTextCtrl* m_pTextCtrlXSize;
185 wxTextCtrl* m_pTextCtrlYSize;
186 wxTextCtrl* m_pTextCtrlNSamples;
187 wxTextCtrl* m_pTextCtrlViewRatio;
191 int m_iDefaultNSamples;
192 double m_dDefaultViewRatio;
196 class DialogGetProjectionParameters : public wxDialog
199 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
200 int iDefaultNView = 0, int iDefaultOffsetView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
201 double dDefaultFocalLength = 1, double dDefaultCenterDetectorLength = 1, double dDefaultViewRatio = 1.,
202 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
203 ~DialogGetProjectionParameters ();
205 unsigned int getNDet ();
206 unsigned int getNView ();
207 unsigned int getOffsetView ();
208 unsigned int getNSamples ();
211 double getRotAngle ();
212 double getViewRatio ();
213 double getScanRatio ();
214 double getFocalLengthRatio ();
215 double getCenterDetectorLengthRatio ();
216 const char* getGeometry();
219 wxTextCtrl* m_pTextCtrlNDet;
220 wxTextCtrl* m_pTextCtrlNView;
221 wxTextCtrl* m_pTextCtrlOffsetView;
222 wxTextCtrl* m_pTextCtrlNSamples;
223 wxTextCtrl* m_pTextCtrlRotAngle;
224 wxTextCtrl* m_pTextCtrlFocalLength;
225 wxTextCtrl* m_pTextCtrlCenterDetectorLength;
226 wxTextCtrl* m_pTextCtrlViewRatio;
227 wxTextCtrl* m_pTextCtrlScanRatio;
228 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
229 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
233 int m_iDefaultOffsetView;
234 int m_iDefaultNSamples;
236 int m_iDefaultGeometry;
237 double m_dDefaultRotAngle;
238 double m_dDefaultFocalLength;
239 double m_dDefaultCenterDetectorLength;
240 double m_dDefaultViewRatio;
241 double m_dDefaultScanRatio;
245 #include "backprojectors.h"
246 class DialogGetReconstructionParameters : public wxDialog
249 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
250 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
251 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
252 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
253 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
254 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
255 int iDefaultTrace = Trace::TRACE_NONE, ReconstructionROI* pROI = NULL);
256 virtual ~DialogGetReconstructionParameters ();
258 unsigned int getXSize();
259 unsigned int getYSize();
260 const char* getFilterName();
261 double getFilterParam();
262 const char* getFilterMethodName();
263 unsigned int getZeropad();
264 const char* getFilterGenerationName();
265 const char* getInterpName();
266 unsigned int getInterpParam();
267 const char* getBackprojectName();
268 void getROI (ReconstructionROI* pROI);
272 wxTextCtrl* m_pTextCtrlXSize;
273 wxTextCtrl* m_pTextCtrlYSize;
274 wxTextCtrl* m_pTextCtrlZeropad;
275 wxTextCtrl* m_pTextCtrlFilterParam;
276 wxTextCtrl* m_pTextCtrlInterpParam;
277 wxTextCtrl* m_pTextCtrlRoiXMin;
278 wxTextCtrl* m_pTextCtrlRoiXMax;
279 wxTextCtrl* m_pTextCtrlRoiYMin;
280 wxTextCtrl* m_pTextCtrlRoiYMax;
281 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
282 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
283 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
284 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
285 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
286 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
290 double m_dDefaultFilterParam;
291 int m_iDefaultZeropad;
292 int m_iDefaultInterpParam;
293 double m_dDefaultRoiXMin;
294 double m_dDefaultRoiXMax;
295 double m_dDefaultRoiYMin;
296 double m_dDefaultRoiYMax;
300 class DialogGetFilterParameters : public wxDialog
303 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.);
304 virtual ~DialogGetFilterParameters ();
306 unsigned int getXSize();
307 unsigned int getYSize();
308 const char* getFilterName();
309 const char* getDomainName();
310 double getFilterParam();
311 double getInputScale();
312 double getOutputScale();
313 double getBandwidth();
316 wxTextCtrl* m_pTextCtrlXSize;
317 wxTextCtrl* m_pTextCtrlYSize;
318 wxTextCtrl* m_pTextCtrlFilterParam;
319 wxTextCtrl* m_pTextCtrlOutputScale;
320 wxTextCtrl* m_pTextCtrlInputScale;
321 wxTextCtrl* m_pTextCtrlBandwidth;
323 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
324 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
328 double m_dDefaultFilterParam;
329 double m_dDefaultBandwidth;
330 double m_dDefaultOutputScale;
331 double m_dDefaultInputScale;
332 int m_iDefaultDomain;
335 class DialogExportParameters : public wxDialog
338 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
339 virtual ~DialogExportParameters () {}
341 const char* getFormatName();
344 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
347 class DialogImportParameters : public wxDialog
350 DialogImportParameters (wxWindow* pParent, int iDefaultFormatID);
351 virtual ~DialogImportParameters () {}
353 const char* getFormatName();
356 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
359 class DialogAutoScaleParameters : public wxDialog
362 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
363 virtual ~DialogAutoScaleParameters() {}
365 bool getMinMax (double* pMin, double* pMax);
366 double getAutoScaleFactor ();
369 const double m_dMean;
370 const double m_dMode;
371 const double m_dMedian;
372 const double m_dStdDev;
374 wxTextCtrl* m_pTextCtrlStdDevFactor;
375 wxRadioBox* m_pRadioBoxCenter;
378 class DialogGetXYSize : public wxDialog
381 DialogGetXYSize (wxWindow* pParent, wxChar const * pwszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
382 virtual ~DialogGetXYSize ();
384 unsigned int getXSize ();
385 unsigned int getYSize ();
388 wxTextCtrl* m_pTextCtrlXSize;
389 wxTextCtrl* m_pTextCtrlYSize;
391 unsigned int m_iDefaultXSize;
392 unsigned int m_iDefaultYSize;
396 class DialogGetConvertPolarParameters : public wxDialog
399 DialogGetConvertPolarParameters (wxWindow* pParent, wxChar const * pwszTitle, int iDefaultXSize = 0,
400 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
401 int iDefaultZeropad = 3, int iHelpID = IDH_DLG_POLAR);
402 virtual ~DialogGetConvertPolarParameters ();
404 unsigned int getXSize();
405 unsigned int getYSize();
406 const char* getInterpolationName();
407 unsigned int getZeropad();
410 wxTextCtrl* m_pTextCtrlXSize;
411 wxTextCtrl* m_pTextCtrlYSize;
412 wxTextCtrl* m_pTextCtrlZeropad;
414 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
418 int m_iDefaultZeropad;