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.39 2003/03/15 10: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"
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 iDefaultOffsetView = 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 getOffsetView ();
203 unsigned int getNSamples ();
206 double getRotAngle ();
207 double getViewRatio ();
208 double getScanRatio ();
209 double getFocalLengthRatio ();
210 double getCenterDetectorLengthRatio ();
211 const char* getGeometry();
214 wxTextCtrl* m_pTextCtrlNDet;
215 wxTextCtrl* m_pTextCtrlNView;
216 wxTextCtrl* m_pTextCtrlOffsetView;
217 wxTextCtrl* m_pTextCtrlNSamples;
218 wxTextCtrl* m_pTextCtrlRotAngle;
219 wxTextCtrl* m_pTextCtrlFocalLength;
220 wxTextCtrl* m_pTextCtrlCenterDetectorLength;
221 wxTextCtrl* m_pTextCtrlViewRatio;
222 wxTextCtrl* m_pTextCtrlScanRatio;
223 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
224 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
228 int m_iDefaultOffsetView;
229 int m_iDefaultNSamples;
231 int m_iDefaultGeometry;
232 double m_dDefaultRotAngle;
233 double m_dDefaultFocalLength;
234 double m_dDefaultCenterDetectorLength;
235 double m_dDefaultViewRatio;
236 double m_dDefaultScanRatio;
240 #include "backprojectors.h"
241 class DialogGetReconstructionParameters : public wxDialog
244 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
245 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
246 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
247 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
248 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
249 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
250 int iDefaultTrace = Trace::TRACE_NONE, ReconstructionROI* pROI = NULL);
251 virtual ~DialogGetReconstructionParameters ();
253 unsigned int getXSize();
254 unsigned int getYSize();
255 const char* getFilterName();
256 double getFilterParam();
257 const char* getFilterMethodName();
258 unsigned int getZeropad();
259 const char* getFilterGenerationName();
260 const char* getInterpName();
261 unsigned int getInterpParam();
262 const char* getBackprojectName();
263 void getROI (ReconstructionROI* pROI);
267 wxTextCtrl* m_pTextCtrlXSize;
268 wxTextCtrl* m_pTextCtrlYSize;
269 wxTextCtrl* m_pTextCtrlZeropad;
270 wxTextCtrl* m_pTextCtrlFilterParam;
271 wxTextCtrl* m_pTextCtrlInterpParam;
272 wxTextCtrl* m_pTextCtrlRoiXMin;
273 wxTextCtrl* m_pTextCtrlRoiXMax;
274 wxTextCtrl* m_pTextCtrlRoiYMin;
275 wxTextCtrl* m_pTextCtrlRoiYMax;
276 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
277 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
278 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
279 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
280 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
281 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
285 double m_dDefaultFilterParam;
286 int m_iDefaultZeropad;
287 int m_iDefaultInterpParam;
288 double m_dDefaultRoiXMin;
289 double m_dDefaultRoiXMax;
290 double m_dDefaultRoiYMin;
291 double m_dDefaultRoiYMax;
295 class DialogGetFilterParameters : public wxDialog
298 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.);
299 virtual ~DialogGetFilterParameters ();
301 unsigned int getXSize();
302 unsigned int getYSize();
303 const char* getFilterName();
304 const char* getDomainName();
305 double getFilterParam();
306 double getInputScale();
307 double getOutputScale();
308 double getBandwidth();
311 wxTextCtrl* m_pTextCtrlXSize;
312 wxTextCtrl* m_pTextCtrlYSize;
313 wxTextCtrl* m_pTextCtrlFilterParam;
314 wxTextCtrl* m_pTextCtrlOutputScale;
315 wxTextCtrl* m_pTextCtrlInputScale;
316 wxTextCtrl* m_pTextCtrlBandwidth;
318 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
319 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
323 double m_dDefaultFilterParam;
324 double m_dDefaultBandwidth;
325 double m_dDefaultOutputScale;
326 double m_dDefaultInputScale;
327 int m_iDefaultDomain;
330 class DialogExportParameters : public wxDialog
333 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
334 virtual ~DialogExportParameters () {}
336 const char* getFormatName();
339 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
342 class DialogImportParameters : public wxDialog
345 DialogImportParameters (wxWindow* pParent, int iDefaultFormatID);
346 virtual ~DialogImportParameters () {}
348 const char* getFormatName();
351 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
354 class DialogAutoScaleParameters : public wxDialog
357 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
358 virtual ~DialogAutoScaleParameters() {}
360 bool getMinMax (double* pMin, double* pMax);
361 double getAutoScaleFactor ();
364 const double m_dMean;
365 const double m_dMode;
366 const double m_dMedian;
367 const double m_dStdDev;
369 wxTextCtrl* m_pTextCtrlStdDevFactor;
370 wxRadioBox* m_pRadioBoxCenter;
373 class DialogGetXYSize : public wxDialog
376 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
377 virtual ~DialogGetXYSize ();
379 unsigned int getXSize ();
380 unsigned int getYSize ();
383 wxTextCtrl* m_pTextCtrlXSize;
384 wxTextCtrl* m_pTextCtrlYSize;
386 unsigned int m_iDefaultXSize;
387 unsigned int m_iDefaultYSize;
391 class DialogGetConvertPolarParameters : public wxDialog
394 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
395 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
396 int iDefaultZeropad = 3, int iHelpID = IDH_DLG_POLAR);
397 virtual ~DialogGetConvertPolarParameters ();
399 unsigned int getXSize();
400 unsigned int getYSize();
401 const char* getInterpolationName();
402 unsigned int getZeropad();
405 wxTextCtrl* m_pTextCtrlXSize;
406 wxTextCtrl* m_pTextCtrlYSize;
407 wxTextCtrl* m_pTextCtrlZeropad;
409 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
413 int m_iDefaultZeropad;