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
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"
40 #include "ctsim-map.h"
43 class CTSimHelpButton : public wxButton
46 CTSimHelpButton (wxWindow* parent, int id)
47 : wxButton (parent, id, _T("Help"))
52 // CLASS StringValueAndTitleListBox
54 // A superclass of wxListBox that can handle string values and titles
55 // and by displaying the title in the list box and returning the string value
57 class StringValueAndTitleListBox : public wxListBox
60 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, wxChar const* const* asTitle,
61 char const* const aszValue[]);
63 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, wxChar const* title,
64 char const* const* aszTitle, char const* const* aszValue);
66 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, wxChar const* title,
67 wxChar const* const* asTitle, char const* const* aszValue);
69 const char* getSelectionStringValue () const;
72 const char* const* m_ppszValues;
76 class StringValueAndTitleRadioBox : public wxRadioBox
79 StringValueAndTitleRadioBox (wxDialog* pParent, wxChar const* strTitle, int nChoices, const char* const aszTitle[], const char* const aszValue[]);
81 const char* getSelectionStringValue () const;
84 const char* const* m_ppszValues;
88 class DialogGetPhantom : public wxDialog
91 DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
92 virtual ~DialogGetPhantom () {}
94 const char* getPhantom ();
97 StringValueAndTitleRadioBox* m_pRadioBoxPhantom;
100 class DialogGetThetaRange : public wxDialog
103 DialogGetThetaRange (wxWindow* pParent, int iDefaultThetaRange = ParallelRaysums::THETA_RANGE_UNCONSTRAINED);
104 virtual ~DialogGetThetaRange () {}
106 int getThetaRange ();
109 wxRadioBox* m_pRadioBoxThetaRange;
114 class ImageFileDocument;
115 class DialogGetComparisonImage : public wxDialog
118 DialogGetComparisonImage (wxWindow* pParent, wxChar const * pwszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
119 virtual ~DialogGetComparisonImage () {}
121 ImageFileDocument* getImageFileDocument ();
123 bool getMakeDifferenceImage();
126 wxListBox* m_pListBoxImageChoices;
127 wxCheckBox* m_pMakeDifferenceImage;
128 const std::vector<ImageFileDocument*>& m_rVecIF;
132 class DialogPreferences : public wxDialog
135 DialogPreferences (wxWindow* pParent, wxChar const* pszTitle, bool bAdvanced, bool bAskNewDocs,
136 bool bVerboseLogging, bool bStartupTips, bool bUseBackgroundTasks);
137 virtual ~DialogPreferences ();
139 bool getAdvancedOptions ();
140 bool getAskDeleteNewDocs ();
141 bool getVerboseLogging ();
142 bool getStartupTips ();
143 bool getUseBackgroundTasks();
146 wxCheckBox* m_pCBAdvancedOptions;
147 wxCheckBox* m_pCBAskDeleteNewDocs;
148 wxCheckBox* m_pCBVerboseLogging;
149 wxCheckBox* m_pCBStartupTips;
150 wxCheckBox* m_pCBUseBackgroundTasks;
155 class DialogGetMinMax : public wxDialog
158 DialogGetMinMax (wxWindow* pParent, wxChar const* pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
159 virtual ~DialogGetMinMax ();
161 double getMinimum ();
162 double getMaximum ();
165 wxTextCtrl* m_pTextCtrlMin;
166 wxTextCtrl* m_pTextCtrlMax;
168 double m_dDefaultMin;
169 double m_dDefaultMax;
173 class DialogGetRasterParameters : public wxDialog
176 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
177 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
178 virtual ~DialogGetRasterParameters ();
180 unsigned int getXSize ();
181 unsigned int getYSize ();
182 unsigned int getNSamples ();
183 double getViewRatio();
186 wxTextCtrl* m_pTextCtrlXSize;
187 wxTextCtrl* m_pTextCtrlYSize;
188 wxTextCtrl* m_pTextCtrlNSamples;
189 wxTextCtrl* m_pTextCtrlViewRatio;
193 int m_iDefaultNSamples;
194 double m_dDefaultViewRatio;
198 class DialogGetProjectionParameters : public wxDialog
201 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
202 int iDefaultNView = 0, int iDefaultOffsetView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
203 double dDefaultFocalLength = 1, double dDefaultCenterDetectorLength = 1, double dDefaultViewRatio = 1.,
204 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
205 ~DialogGetProjectionParameters ();
207 unsigned int getNDet ();
208 unsigned int getNView ();
209 unsigned int getOffsetView ();
210 unsigned int getNSamples ();
213 double getRotAngle ();
214 double getViewRatio ();
215 double getScanRatio ();
216 double getFocalLengthRatio ();
217 double getCenterDetectorLengthRatio ();
218 const char* getGeometry();
221 wxTextCtrl* m_pTextCtrlNDet;
222 wxTextCtrl* m_pTextCtrlNView;
223 wxTextCtrl* m_pTextCtrlOffsetView;
224 wxTextCtrl* m_pTextCtrlNSamples;
225 wxTextCtrl* m_pTextCtrlRotAngle;
226 wxTextCtrl* m_pTextCtrlFocalLength;
227 wxTextCtrl* m_pTextCtrlCenterDetectorLength;
228 wxTextCtrl* m_pTextCtrlViewRatio;
229 wxTextCtrl* m_pTextCtrlScanRatio;
230 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
231 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
235 int m_iDefaultOffsetView;
236 int m_iDefaultNSamples;
238 int m_iDefaultGeometry;
239 double m_dDefaultRotAngle;
240 double m_dDefaultFocalLength;
241 double m_dDefaultCenterDetectorLength;
242 double m_dDefaultViewRatio;
243 double m_dDefaultScanRatio;
247 #include "backprojectors.h"
248 class DialogGetReconstructionParameters : public wxDialog
251 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
252 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
253 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
254 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
255 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
256 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
257 int iDefaultTrace = Trace::TRACE_NONE, ReconstructionROI* pROI = NULL);
258 virtual ~DialogGetReconstructionParameters ();
260 unsigned int getXSize();
261 unsigned int getYSize();
262 const char* getFilterName();
263 double getFilterParam();
264 const char* getFilterMethodName();
265 unsigned int getZeropad();
266 const char* getFilterGenerationName();
267 const char* getInterpName();
268 unsigned int getInterpParam();
269 const char* getBackprojectName();
270 void getROI (ReconstructionROI* pROI);
274 wxTextCtrl* m_pTextCtrlXSize;
275 wxTextCtrl* m_pTextCtrlYSize;
276 wxTextCtrl* m_pTextCtrlZeropad;
277 wxTextCtrl* m_pTextCtrlFilterParam;
278 wxTextCtrl* m_pTextCtrlInterpParam;
279 wxTextCtrl* m_pTextCtrlRoiXMin;
280 wxTextCtrl* m_pTextCtrlRoiXMax;
281 wxTextCtrl* m_pTextCtrlRoiYMin;
282 wxTextCtrl* m_pTextCtrlRoiYMax;
283 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
284 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
285 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
286 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
287 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
288 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
292 double m_dDefaultFilterParam;
293 int m_iDefaultZeropad;
294 int m_iDefaultInterpParam;
295 double m_dDefaultRoiXMin;
296 double m_dDefaultRoiXMax;
297 double m_dDefaultRoiYMin;
298 double m_dDefaultRoiYMax;
302 class DialogGetFilterParameters : public wxDialog
305 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.);
306 virtual ~DialogGetFilterParameters ();
308 unsigned int getXSize();
309 unsigned int getYSize();
310 const char* getFilterName();
311 const char* getDomainName();
312 double getFilterParam();
313 double getInputScale();
314 double getOutputScale();
315 double getBandwidth();
318 wxTextCtrl* m_pTextCtrlXSize;
319 wxTextCtrl* m_pTextCtrlYSize;
320 wxTextCtrl* m_pTextCtrlFilterParam;
321 wxTextCtrl* m_pTextCtrlOutputScale;
322 wxTextCtrl* m_pTextCtrlInputScale;
323 wxTextCtrl* m_pTextCtrlBandwidth;
325 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
326 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
330 double m_dDefaultFilterParam;
331 double m_dDefaultBandwidth;
332 double m_dDefaultOutputScale;
333 double m_dDefaultInputScale;
334 int m_iDefaultDomain;
337 class DialogExportParameters : public wxDialog
340 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
341 virtual ~DialogExportParameters () {}
343 const char* getFormatName();
346 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
349 class DialogImportParameters : public wxDialog
352 DialogImportParameters (wxWindow* pParent, int iDefaultFormatID);
353 virtual ~DialogImportParameters () {}
355 const char* getFormatName();
358 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
361 class DialogAutoScaleParameters : public wxDialog
364 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
365 virtual ~DialogAutoScaleParameters() {}
367 bool getMinMax (double* pMin, double* pMax);
368 double getAutoScaleFactor ();
371 const double m_dMean;
372 const double m_dMode;
373 const double m_dMedian;
374 const double m_dStdDev;
376 wxTextCtrl* m_pTextCtrlStdDevFactor;
377 wxRadioBox* m_pRadioBoxCenter;
380 class DialogGetXYSize : public wxDialog
383 DialogGetXYSize (wxWindow* pParent, wxChar const * pwszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
384 virtual ~DialogGetXYSize ();
386 unsigned int getXSize ();
387 unsigned int getYSize ();
390 wxTextCtrl* m_pTextCtrlXSize;
391 wxTextCtrl* m_pTextCtrlYSize;
393 unsigned int m_iDefaultXSize;
394 unsigned int m_iDefaultYSize;
398 class DialogGetConvertPolarParameters : public wxDialog
401 DialogGetConvertPolarParameters (wxWindow* pParent, wxChar const * pwszTitle, int iDefaultXSize = 0,
402 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
403 int iDefaultZeropad = 3, int iHelpID = IDH_DLG_POLAR);
404 virtual ~DialogGetConvertPolarParameters ();
406 unsigned int getXSize();
407 unsigned int getYSize();
408 const char* getInterpolationName();
409 unsigned int getZeropad();
412 wxTextCtrl* m_pTextCtrlXSize;
413 wxTextCtrl* m_pTextCtrlYSize;
414 wxTextCtrl* m_pTextCtrlZeropad;
416 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
420 int m_iDefaultZeropad;