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.27 2001/02/16 00:28:41 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* aszTitle[], const char* aszValue[]);
61 const char* getSelectionStringValue () const;
64 const char** m_ppszValues;
68 class StringValueAndTitleRadioBox : public wxRadioBox
71 StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* aszTitle[], const char* aszValue[]);
73 const char* getSelectionStringValue () const;
76 const char** 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 virtual ~DialogPreferences ();
118 bool getAdvancedOptions ();
119 bool getAskDeleteNewDocs ();
122 wxCheckBox* m_pCBAdvancedOptions;
123 wxCheckBox* m_pCBAskDeleteNewDocs;
128 class DialogGetMinMax : public wxDialog
131 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
132 virtual ~DialogGetMinMax ();
134 double getMinimum ();
135 double getMaximum ();
138 wxTextCtrl* m_pTextCtrlMin;
139 wxTextCtrl* m_pTextCtrlMax;
141 double m_dDefaultMin;
142 double m_dDefaultMax;
146 class DialogGetRasterParameters : public wxDialog
149 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
150 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
151 virtual ~DialogGetRasterParameters ();
153 unsigned int getXSize ();
154 unsigned int getYSize ();
155 unsigned int getNSamples ();
156 double getViewRatio();
159 wxTextCtrl* m_pTextCtrlXSize;
160 wxTextCtrl* m_pTextCtrlYSize;
161 wxTextCtrl* m_pTextCtrlNSamples;
162 wxTextCtrl* m_pTextCtrlViewRatio;
166 int m_iDefaultNSamples;
167 double m_dDefaultViewRatio;
171 class DialogGetProjectionParameters : public wxDialog
174 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
175 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
176 double dDefaultFocalLength = 1, double dDefaultViewRatio = 1.,
177 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
178 ~DialogGetProjectionParameters ();
180 unsigned int getNDet ();
181 unsigned int getNView ();
182 unsigned int getNSamples ();
185 double getRotAngle ();
186 double getViewRatio ();
187 double getScanRatio ();
188 double getFocalLengthRatio ();
189 const char* getGeometry();
192 wxTextCtrl* m_pTextCtrlNDet;
193 wxTextCtrl* m_pTextCtrlNView;
194 wxTextCtrl* m_pTextCtrlNSamples;
195 wxTextCtrl* m_pTextCtrlRotAngle;
196 wxTextCtrl* m_pTextCtrlFocalLength;
197 wxTextCtrl* m_pTextCtrlViewRatio;
198 wxTextCtrl* m_pTextCtrlScanRatio;
199 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
200 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
204 int m_iDefaultNSamples;
206 int m_iDefaultGeometry;
207 double m_dDefaultRotAngle;
208 double m_dDefaultFocalLength;
209 double m_dDefaultViewRatio;
210 double m_dDefaultScanRatio;
214 #include "backprojectors.h"
215 class DialogGetReconstructionParameters : public wxDialog
218 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
219 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
220 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
221 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
222 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
223 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
224 int iDefaultTrace = Trace::TRACE_NONE);
225 virtual ~DialogGetReconstructionParameters ();
227 unsigned int getXSize();
228 unsigned int getYSize();
229 const char* getFilterName();
230 double getFilterParam();
231 const char* getFilterMethodName();
232 unsigned int getZeropad();
233 const char* getFilterGenerationName();
234 const char* getInterpName();
235 unsigned int getInterpParam();
236 const char* getBackprojectName();
240 wxTextCtrl* m_pTextCtrlXSize;
241 wxTextCtrl* m_pTextCtrlYSize;
242 wxTextCtrl* m_pTextCtrlZeropad;
243 wxTextCtrl* m_pTextCtrlFilterParam;
244 wxTextCtrl* m_pTextCtrlInterpParam;
246 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
247 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
248 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
249 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
250 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
251 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
255 double m_dDefaultFilterParam;
256 int m_iDefaultZeropad;
257 int m_iDefaultInterpParam;
262 class DialogGetFilterParameters : public wxDialog
265 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.);
266 virtual ~DialogGetFilterParameters ();
268 unsigned int getXSize();
269 unsigned int getYSize();
270 const char* getFilterName();
271 const char* getDomainName();
272 double getFilterParam();
273 double getInputScale();
274 double getOutputScale();
275 double getBandwidth();
278 wxTextCtrl* m_pTextCtrlXSize;
279 wxTextCtrl* m_pTextCtrlYSize;
280 wxTextCtrl* m_pTextCtrlFilterParam;
281 wxTextCtrl* m_pTextCtrlOutputScale;
282 wxTextCtrl* m_pTextCtrlInputScale;
283 wxTextCtrl* m_pTextCtrlBandwidth;
285 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
286 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
290 double m_dDefaultFilterParam;
291 double m_dDefaultBandwidth;
292 double m_dDefaultOutputScale;
293 double m_dDefaultInputScale;
294 int m_iDefaultDomain;
297 class DialogExportParameters : public wxDialog
300 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
301 virtual ~DialogExportParameters () {}
303 const char* getFormatName();
306 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
309 class DialogAutoScaleParameters : public wxDialog
312 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
313 virtual ~DialogAutoScaleParameters() {}
315 bool getMinMax (double* pMin, double* pMax);
316 double getAutoScaleFactor ();
319 const double m_dMean;
320 const double m_dMode;
321 const double m_dMedian;
322 const double m_dStdDev;
324 wxTextCtrl* m_pTextCtrlStdDevFactor;
325 wxRadioBox* m_pRadioBoxCenter;
328 class DialogGetXYSize : public wxDialog
331 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
332 virtual ~DialogGetXYSize ();
334 unsigned int getXSize ();
335 unsigned int getYSize ();
338 wxTextCtrl* m_pTextCtrlXSize;
339 wxTextCtrl* m_pTextCtrlYSize;
341 unsigned int m_iDefaultXSize;
342 unsigned int m_iDefaultYSize;
346 class DialogGetConvertPolarParameters : public wxDialog
349 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
350 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
351 int iDefaultZeropad = 1);
352 virtual ~DialogGetConvertPolarParameters ();
354 unsigned int getXSize();
355 unsigned int getYSize();
356 const char* getInterpolationName();
357 unsigned int getZeropad();
360 wxTextCtrl* m_pTextCtrlXSize;
361 wxTextCtrl* m_pTextCtrlYSize;
362 wxTextCtrl* m_pTextCtrlZeropad;
364 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
368 int m_iDefaultZeropad;