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.36 2001/03/30 19:17:32 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"
40 #include "ctsim-map.h"
43 class CTSimHelpButton : public wxButton
46 CTSimHelpButton (wxWindow* parent, int id)
47 : wxButton (parent, id, "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, const char* const aszTitle[], const char* const aszValue[]);
62 const char* getSelectionStringValue () const;
65 const char* const* m_ppszValues;
69 class StringValueAndTitleRadioBox : public wxRadioBox
72 StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* const aszTitle[], const char* const aszValue[]);
74 const char* getSelectionStringValue () const;
77 const char* const* m_ppszValues;
81 class DialogGetPhantom : public wxDialog
84 DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
85 virtual ~DialogGetPhantom () {}
87 const char* getPhantom ();
90 StringValueAndTitleRadioBox* m_pRadioBoxPhantom;
93 class DialogGetThetaRange : public wxDialog
96 DialogGetThetaRange (wxWindow* pParent, int iDefaultThetaRange = ParallelRaysums::THETA_RANGE_UNCONSTRAINED);
97 virtual ~DialogGetThetaRange () {}
102 wxRadioBox* m_pRadioBoxThetaRange;
107 class ImageFileDocument;
108 class DialogGetComparisonImage : public wxDialog
111 DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
112 virtual ~DialogGetComparisonImage () {}
114 ImageFileDocument* getImageFileDocument ();
116 bool getMakeDifferenceImage();
119 wxListBox* m_pListBoxImageChoices;
120 wxCheckBox* m_pMakeDifferenceImage;
121 const std::vector<ImageFileDocument*>& m_rVecIF;
125 class DialogPreferences : public wxDialog
128 DialogPreferences (wxWindow* pParent, const char* const pszTitle, bool bAdvanced, bool bAskNewDocs,
129 bool bVerboseLogging, bool bStartupTips, bool bUseBackgroundTasks);
130 virtual ~DialogPreferences ();
132 bool getAdvancedOptions ();
133 bool getAskDeleteNewDocs ();
134 bool getVerboseLogging ();
135 bool getStartupTips ();
136 bool getUseBackgroundTasks();
139 wxCheckBox* m_pCBAdvancedOptions;
140 wxCheckBox* m_pCBAskDeleteNewDocs;
141 wxCheckBox* m_pCBVerboseLogging;
142 wxCheckBox* m_pCBStartupTips;
143 wxCheckBox* m_pCBUseBackgroundTasks;
148 class DialogGetMinMax : public wxDialog
151 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
152 virtual ~DialogGetMinMax ();
154 double getMinimum ();
155 double getMaximum ();
158 wxTextCtrl* m_pTextCtrlMin;
159 wxTextCtrl* m_pTextCtrlMax;
161 double m_dDefaultMin;
162 double m_dDefaultMax;
166 class DialogGetRasterParameters : public wxDialog
169 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
170 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
171 virtual ~DialogGetRasterParameters ();
173 unsigned int getXSize ();
174 unsigned int getYSize ();
175 unsigned int getNSamples ();
176 double getViewRatio();
179 wxTextCtrl* m_pTextCtrlXSize;
180 wxTextCtrl* m_pTextCtrlYSize;
181 wxTextCtrl* m_pTextCtrlNSamples;
182 wxTextCtrl* m_pTextCtrlViewRatio;
186 int m_iDefaultNSamples;
187 double m_dDefaultViewRatio;
191 class DialogGetProjectionParameters : public wxDialog
194 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
195 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
196 double dDefaultFocalLength = 1, double dDefaultCenterDetectorLength = 1, double dDefaultViewRatio = 1.,
197 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
198 ~DialogGetProjectionParameters ();
200 unsigned int getNDet ();
201 unsigned int getNView ();
202 unsigned int getNSamples ();
205 double getRotAngle ();
206 double getViewRatio ();
207 double getScanRatio ();
208 double getFocalLengthRatio ();
209 double getCenterDetectorLengthRatio ();
210 const char* getGeometry();
213 wxTextCtrl* m_pTextCtrlNDet;
214 wxTextCtrl* m_pTextCtrlNView;
215 wxTextCtrl* m_pTextCtrlNSamples;
216 wxTextCtrl* m_pTextCtrlRotAngle;
217 wxTextCtrl* m_pTextCtrlFocalLength;
218 wxTextCtrl* m_pTextCtrlCenterDetectorLength;
219 wxTextCtrl* m_pTextCtrlViewRatio;
220 wxTextCtrl* m_pTextCtrlScanRatio;
221 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
222 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
226 int m_iDefaultNSamples;
228 int m_iDefaultGeometry;
229 double m_dDefaultRotAngle;
230 double m_dDefaultFocalLength;
231 double m_dDefaultCenterDetectorLength;
232 double m_dDefaultViewRatio;
233 double m_dDefaultScanRatio;
237 #include "backprojectors.h"
238 class DialogGetReconstructionParameters : public wxDialog
241 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
242 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
243 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
244 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
245 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
246 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
247 int iDefaultTrace = Trace::TRACE_NONE, ReconstructionROI* pROI = NULL);
248 virtual ~DialogGetReconstructionParameters ();
250 unsigned int getXSize();
251 unsigned int getYSize();
252 const char* getFilterName();
253 double getFilterParam();
254 const char* getFilterMethodName();
255 unsigned int getZeropad();
256 const char* getFilterGenerationName();
257 const char* getInterpName();
258 unsigned int getInterpParam();
259 const char* getBackprojectName();
260 void getROI (ReconstructionROI* pROI);
264 wxTextCtrl* m_pTextCtrlXSize;
265 wxTextCtrl* m_pTextCtrlYSize;
266 wxTextCtrl* m_pTextCtrlZeropad;
267 wxTextCtrl* m_pTextCtrlFilterParam;
268 wxTextCtrl* m_pTextCtrlInterpParam;
269 wxTextCtrl* m_pTextCtrlRoiXMin;
270 wxTextCtrl* m_pTextCtrlRoiXMax;
271 wxTextCtrl* m_pTextCtrlRoiYMin;
272 wxTextCtrl* m_pTextCtrlRoiYMax;
273 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
274 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
275 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
276 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
277 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
278 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
282 double m_dDefaultFilterParam;
283 int m_iDefaultZeropad;
284 int m_iDefaultInterpParam;
285 double m_dDefaultRoiXMin;
286 double m_dDefaultRoiXMax;
287 double m_dDefaultRoiYMin;
288 double m_dDefaultRoiYMax;
292 class DialogGetFilterParameters : public wxDialog
295 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.);
296 virtual ~DialogGetFilterParameters ();
298 unsigned int getXSize();
299 unsigned int getYSize();
300 const char* getFilterName();
301 const char* getDomainName();
302 double getFilterParam();
303 double getInputScale();
304 double getOutputScale();
305 double getBandwidth();
308 wxTextCtrl* m_pTextCtrlXSize;
309 wxTextCtrl* m_pTextCtrlYSize;
310 wxTextCtrl* m_pTextCtrlFilterParam;
311 wxTextCtrl* m_pTextCtrlOutputScale;
312 wxTextCtrl* m_pTextCtrlInputScale;
313 wxTextCtrl* m_pTextCtrlBandwidth;
315 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
316 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
320 double m_dDefaultFilterParam;
321 double m_dDefaultBandwidth;
322 double m_dDefaultOutputScale;
323 double m_dDefaultInputScale;
324 int m_iDefaultDomain;
327 class DialogExportParameters : public wxDialog
330 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
331 virtual ~DialogExportParameters () {}
333 const char* getFormatName();
336 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
339 class DialogImportParameters : public wxDialog
342 DialogImportParameters (wxWindow* pParent, int iDefaultFormatID);
343 virtual ~DialogImportParameters () {}
345 const char* getFormatName();
348 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
351 class DialogAutoScaleParameters : public wxDialog
354 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
355 virtual ~DialogAutoScaleParameters() {}
357 bool getMinMax (double* pMin, double* pMax);
358 double getAutoScaleFactor ();
361 const double m_dMean;
362 const double m_dMode;
363 const double m_dMedian;
364 const double m_dStdDev;
366 wxTextCtrl* m_pTextCtrlStdDevFactor;
367 wxRadioBox* m_pRadioBoxCenter;
370 class DialogGetXYSize : public wxDialog
373 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
374 virtual ~DialogGetXYSize ();
376 unsigned int getXSize ();
377 unsigned int getYSize ();
380 wxTextCtrl* m_pTextCtrlXSize;
381 wxTextCtrl* m_pTextCtrlYSize;
383 unsigned int m_iDefaultXSize;
384 unsigned int m_iDefaultYSize;
388 class DialogGetConvertPolarParameters : public wxDialog
391 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
392 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
393 int iDefaultZeropad = 1, int iHelpID = IDH_DLG_POLAR);
394 virtual ~DialogGetConvertPolarParameters ();
396 unsigned int getXSize();
397 unsigned int getYSize();
398 const char* getInterpolationName();
399 unsigned int getZeropad();
402 wxTextCtrl* m_pTextCtrlXSize;
403 wxTextCtrl* m_pTextCtrlYSize;
404 wxTextCtrl* m_pTextCtrlZeropad;
406 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
410 int m_iDefaultZeropad;