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.34 2001/03/11 15:27:30 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* const aszTitle[], const char* const aszValue[]);
61 const char* getSelectionStringValue () const;
64 const char* const* m_ppszValues;
68 class StringValueAndTitleRadioBox : public wxRadioBox
71 StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* const aszTitle[], const char* const aszValue[]);
73 const char* getSelectionStringValue () const;
76 const char* const* 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, bool bStartupTips, bool bUseBackgroundTasks);
117 virtual ~DialogPreferences ();
119 bool getAdvancedOptions ();
120 bool getAskDeleteNewDocs ();
121 bool getVerboseLogging ();
122 bool getStartupTips ();
123 bool getUseBackgroundTasks();
126 wxCheckBox* m_pCBAdvancedOptions;
127 wxCheckBox* m_pCBAskDeleteNewDocs;
128 wxCheckBox* m_pCBVerboseLogging;
129 wxCheckBox* m_pCBStartupTips;
130 wxCheckBox* m_pCBUseBackgroundTasks;
135 class DialogGetMinMax : public wxDialog
138 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
139 virtual ~DialogGetMinMax ();
141 double getMinimum ();
142 double getMaximum ();
145 wxTextCtrl* m_pTextCtrlMin;
146 wxTextCtrl* m_pTextCtrlMax;
148 double m_dDefaultMin;
149 double m_dDefaultMax;
153 class DialogGetRasterParameters : public wxDialog
156 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
157 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
158 virtual ~DialogGetRasterParameters ();
160 unsigned int getXSize ();
161 unsigned int getYSize ();
162 unsigned int getNSamples ();
163 double getViewRatio();
166 wxTextCtrl* m_pTextCtrlXSize;
167 wxTextCtrl* m_pTextCtrlYSize;
168 wxTextCtrl* m_pTextCtrlNSamples;
169 wxTextCtrl* m_pTextCtrlViewRatio;
173 int m_iDefaultNSamples;
174 double m_dDefaultViewRatio;
178 class DialogGetProjectionParameters : public wxDialog
181 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
182 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
183 double dDefaultFocalLength = 1, double dDefaultCenterDetectorLength = 1, double dDefaultViewRatio = 1.,
184 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
185 ~DialogGetProjectionParameters ();
187 unsigned int getNDet ();
188 unsigned int getNView ();
189 unsigned int getNSamples ();
192 double getRotAngle ();
193 double getViewRatio ();
194 double getScanRatio ();
195 double getFocalLengthRatio ();
196 double getCenterDetectorLengthRatio ();
197 const char* getGeometry();
200 wxTextCtrl* m_pTextCtrlNDet;
201 wxTextCtrl* m_pTextCtrlNView;
202 wxTextCtrl* m_pTextCtrlNSamples;
203 wxTextCtrl* m_pTextCtrlRotAngle;
204 wxTextCtrl* m_pTextCtrlFocalLength;
205 wxTextCtrl* m_pTextCtrlCenterDetectorLength;
206 wxTextCtrl* m_pTextCtrlViewRatio;
207 wxTextCtrl* m_pTextCtrlScanRatio;
208 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
209 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
213 int m_iDefaultNSamples;
215 int m_iDefaultGeometry;
216 double m_dDefaultRotAngle;
217 double m_dDefaultFocalLength;
218 double m_dDefaultCenterDetectorLength;
219 double m_dDefaultViewRatio;
220 double m_dDefaultScanRatio;
224 #include "backprojectors.h"
225 class DialogGetReconstructionParameters : public wxDialog
228 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
229 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
230 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
231 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
232 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
233 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
234 int iDefaultTrace = Trace::TRACE_NONE, ReconstructionROI* pROI = NULL);
235 virtual ~DialogGetReconstructionParameters ();
237 unsigned int getXSize();
238 unsigned int getYSize();
239 const char* getFilterName();
240 double getFilterParam();
241 const char* getFilterMethodName();
242 unsigned int getZeropad();
243 const char* getFilterGenerationName();
244 const char* getInterpName();
245 unsigned int getInterpParam();
246 const char* getBackprojectName();
247 void getROI (ReconstructionROI* pROI);
251 wxTextCtrl* m_pTextCtrlXSize;
252 wxTextCtrl* m_pTextCtrlYSize;
253 wxTextCtrl* m_pTextCtrlZeropad;
254 wxTextCtrl* m_pTextCtrlFilterParam;
255 wxTextCtrl* m_pTextCtrlInterpParam;
256 wxTextCtrl* m_pTextCtrlRoiXMin;
257 wxTextCtrl* m_pTextCtrlRoiXMax;
258 wxTextCtrl* m_pTextCtrlRoiYMin;
259 wxTextCtrl* m_pTextCtrlRoiYMax;
260 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
261 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
262 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
263 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
264 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
265 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
269 double m_dDefaultFilterParam;
270 int m_iDefaultZeropad;
271 int m_iDefaultInterpParam;
272 double m_dDefaultRoiXMin;
273 double m_dDefaultRoiXMax;
274 double m_dDefaultRoiYMin;
275 double m_dDefaultRoiYMax;
279 class DialogGetFilterParameters : public wxDialog
282 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.);
283 virtual ~DialogGetFilterParameters ();
285 unsigned int getXSize();
286 unsigned int getYSize();
287 const char* getFilterName();
288 const char* getDomainName();
289 double getFilterParam();
290 double getInputScale();
291 double getOutputScale();
292 double getBandwidth();
295 wxTextCtrl* m_pTextCtrlXSize;
296 wxTextCtrl* m_pTextCtrlYSize;
297 wxTextCtrl* m_pTextCtrlFilterParam;
298 wxTextCtrl* m_pTextCtrlOutputScale;
299 wxTextCtrl* m_pTextCtrlInputScale;
300 wxTextCtrl* m_pTextCtrlBandwidth;
302 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
303 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
307 double m_dDefaultFilterParam;
308 double m_dDefaultBandwidth;
309 double m_dDefaultOutputScale;
310 double m_dDefaultInputScale;
311 int m_iDefaultDomain;
314 class DialogExportParameters : public wxDialog
317 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
318 virtual ~DialogExportParameters () {}
320 const char* getFormatName();
323 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
326 class DialogImportParameters : public wxDialog
329 DialogImportParameters (wxWindow* pParent, int iDefaultFormatID);
330 virtual ~DialogImportParameters () {}
332 const char* getFormatName();
335 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
338 class DialogAutoScaleParameters : public wxDialog
341 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
342 virtual ~DialogAutoScaleParameters() {}
344 bool getMinMax (double* pMin, double* pMax);
345 double getAutoScaleFactor ();
348 const double m_dMean;
349 const double m_dMode;
350 const double m_dMedian;
351 const double m_dStdDev;
353 wxTextCtrl* m_pTextCtrlStdDevFactor;
354 wxRadioBox* m_pRadioBoxCenter;
357 class DialogGetXYSize : public wxDialog
360 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
361 virtual ~DialogGetXYSize ();
363 unsigned int getXSize ();
364 unsigned int getYSize ();
367 wxTextCtrl* m_pTextCtrlXSize;
368 wxTextCtrl* m_pTextCtrlYSize;
370 unsigned int m_iDefaultXSize;
371 unsigned int m_iDefaultYSize;
375 class DialogGetConvertPolarParameters : public wxDialog
378 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
379 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
380 int iDefaultZeropad = 1);
381 virtual ~DialogGetConvertPolarParameters ();
383 unsigned int getXSize();
384 unsigned int getYSize();
385 const char* getInterpolationName();
386 unsigned int getZeropad();
389 wxTextCtrl* m_pTextCtrlXSize;
390 wxTextCtrl* m_pTextCtrlYSize;
391 wxTextCtrl* m_pTextCtrlZeropad;
393 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
397 int m_iDefaultZeropad;