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.35 2001/03/13 04:44:25 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;
92 class DialogGetThetaRange : public wxDialog
95 DialogGetThetaRange (wxWindow* pParent, int iDefaultThetaRange = ParallelRaysums::THETA_RANGE_UNCONSTRAINED);
96 virtual ~DialogGetThetaRange () {}
101 wxRadioBox* m_pRadioBoxThetaRange;
106 class ImageFileDocument;
107 class DialogGetComparisonImage : public wxDialog
110 DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
111 virtual ~DialogGetComparisonImage () {}
113 ImageFileDocument* getImageFileDocument ();
115 bool getMakeDifferenceImage();
118 wxListBox* m_pListBoxImageChoices;
119 wxCheckBox* m_pMakeDifferenceImage;
120 const std::vector<ImageFileDocument*>& m_rVecIF;
124 class DialogPreferences : public wxDialog
127 DialogPreferences (wxWindow* pParent, const char* const pszTitle, bool bAdvanced, bool bAskNewDocs,
128 bool bVerboseLogging, bool bStartupTips, bool bUseBackgroundTasks);
129 virtual ~DialogPreferences ();
131 bool getAdvancedOptions ();
132 bool getAskDeleteNewDocs ();
133 bool getVerboseLogging ();
134 bool getStartupTips ();
135 bool getUseBackgroundTasks();
138 wxCheckBox* m_pCBAdvancedOptions;
139 wxCheckBox* m_pCBAskDeleteNewDocs;
140 wxCheckBox* m_pCBVerboseLogging;
141 wxCheckBox* m_pCBStartupTips;
142 wxCheckBox* m_pCBUseBackgroundTasks;
147 class DialogGetMinMax : public wxDialog
150 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
151 virtual ~DialogGetMinMax ();
153 double getMinimum ();
154 double getMaximum ();
157 wxTextCtrl* m_pTextCtrlMin;
158 wxTextCtrl* m_pTextCtrlMax;
160 double m_dDefaultMin;
161 double m_dDefaultMax;
165 class DialogGetRasterParameters : public wxDialog
168 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
169 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
170 virtual ~DialogGetRasterParameters ();
172 unsigned int getXSize ();
173 unsigned int getYSize ();
174 unsigned int getNSamples ();
175 double getViewRatio();
178 wxTextCtrl* m_pTextCtrlXSize;
179 wxTextCtrl* m_pTextCtrlYSize;
180 wxTextCtrl* m_pTextCtrlNSamples;
181 wxTextCtrl* m_pTextCtrlViewRatio;
185 int m_iDefaultNSamples;
186 double m_dDefaultViewRatio;
190 class DialogGetProjectionParameters : public wxDialog
193 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
194 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
195 double dDefaultFocalLength = 1, double dDefaultCenterDetectorLength = 1, double dDefaultViewRatio = 1.,
196 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
197 ~DialogGetProjectionParameters ();
199 unsigned int getNDet ();
200 unsigned int getNView ();
201 unsigned int getNSamples ();
204 double getRotAngle ();
205 double getViewRatio ();
206 double getScanRatio ();
207 double getFocalLengthRatio ();
208 double getCenterDetectorLengthRatio ();
209 const char* getGeometry();
212 wxTextCtrl* m_pTextCtrlNDet;
213 wxTextCtrl* m_pTextCtrlNView;
214 wxTextCtrl* m_pTextCtrlNSamples;
215 wxTextCtrl* m_pTextCtrlRotAngle;
216 wxTextCtrl* m_pTextCtrlFocalLength;
217 wxTextCtrl* m_pTextCtrlCenterDetectorLength;
218 wxTextCtrl* m_pTextCtrlViewRatio;
219 wxTextCtrl* m_pTextCtrlScanRatio;
220 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
221 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
225 int m_iDefaultNSamples;
227 int m_iDefaultGeometry;
228 double m_dDefaultRotAngle;
229 double m_dDefaultFocalLength;
230 double m_dDefaultCenterDetectorLength;
231 double m_dDefaultViewRatio;
232 double m_dDefaultScanRatio;
236 #include "backprojectors.h"
237 class DialogGetReconstructionParameters : public wxDialog
240 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
241 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
242 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
243 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
244 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
245 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
246 int iDefaultTrace = Trace::TRACE_NONE, ReconstructionROI* pROI = NULL);
247 virtual ~DialogGetReconstructionParameters ();
249 unsigned int getXSize();
250 unsigned int getYSize();
251 const char* getFilterName();
252 double getFilterParam();
253 const char* getFilterMethodName();
254 unsigned int getZeropad();
255 const char* getFilterGenerationName();
256 const char* getInterpName();
257 unsigned int getInterpParam();
258 const char* getBackprojectName();
259 void getROI (ReconstructionROI* pROI);
263 wxTextCtrl* m_pTextCtrlXSize;
264 wxTextCtrl* m_pTextCtrlYSize;
265 wxTextCtrl* m_pTextCtrlZeropad;
266 wxTextCtrl* m_pTextCtrlFilterParam;
267 wxTextCtrl* m_pTextCtrlInterpParam;
268 wxTextCtrl* m_pTextCtrlRoiXMin;
269 wxTextCtrl* m_pTextCtrlRoiXMax;
270 wxTextCtrl* m_pTextCtrlRoiYMin;
271 wxTextCtrl* m_pTextCtrlRoiYMax;
272 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
273 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
274 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
275 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
276 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
277 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
281 double m_dDefaultFilterParam;
282 int m_iDefaultZeropad;
283 int m_iDefaultInterpParam;
284 double m_dDefaultRoiXMin;
285 double m_dDefaultRoiXMax;
286 double m_dDefaultRoiYMin;
287 double m_dDefaultRoiYMax;
291 class DialogGetFilterParameters : public wxDialog
294 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.);
295 virtual ~DialogGetFilterParameters ();
297 unsigned int getXSize();
298 unsigned int getYSize();
299 const char* getFilterName();
300 const char* getDomainName();
301 double getFilterParam();
302 double getInputScale();
303 double getOutputScale();
304 double getBandwidth();
307 wxTextCtrl* m_pTextCtrlXSize;
308 wxTextCtrl* m_pTextCtrlYSize;
309 wxTextCtrl* m_pTextCtrlFilterParam;
310 wxTextCtrl* m_pTextCtrlOutputScale;
311 wxTextCtrl* m_pTextCtrlInputScale;
312 wxTextCtrl* m_pTextCtrlBandwidth;
314 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
315 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
319 double m_dDefaultFilterParam;
320 double m_dDefaultBandwidth;
321 double m_dDefaultOutputScale;
322 double m_dDefaultInputScale;
323 int m_iDefaultDomain;
326 class DialogExportParameters : public wxDialog
329 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
330 virtual ~DialogExportParameters () {}
332 const char* getFormatName();
335 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
338 class DialogImportParameters : public wxDialog
341 DialogImportParameters (wxWindow* pParent, int iDefaultFormatID);
342 virtual ~DialogImportParameters () {}
344 const char* getFormatName();
347 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
350 class DialogAutoScaleParameters : public wxDialog
353 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
354 virtual ~DialogAutoScaleParameters() {}
356 bool getMinMax (double* pMin, double* pMax);
357 double getAutoScaleFactor ();
360 const double m_dMean;
361 const double m_dMode;
362 const double m_dMedian;
363 const double m_dStdDev;
365 wxTextCtrl* m_pTextCtrlStdDevFactor;
366 wxRadioBox* m_pRadioBoxCenter;
369 class DialogGetXYSize : public wxDialog
372 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
373 virtual ~DialogGetXYSize ();
375 unsigned int getXSize ();
376 unsigned int getYSize ();
379 wxTextCtrl* m_pTextCtrlXSize;
380 wxTextCtrl* m_pTextCtrlYSize;
382 unsigned int m_iDefaultXSize;
383 unsigned int m_iDefaultYSize;
387 class DialogGetConvertPolarParameters : public wxDialog
390 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
391 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
392 int iDefaultZeropad = 1);
393 virtual ~DialogGetConvertPolarParameters ();
395 unsigned int getXSize();
396 unsigned int getYSize();
397 const char* getInterpolationName();
398 unsigned int getZeropad();
401 wxTextCtrl* m_pTextCtrlXSize;
402 wxTextCtrl* m_pTextCtrlYSize;
403 wxTextCtrl* m_pTextCtrlZeropad;
405 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
409 int m_iDefaultZeropad;