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.29 2001/02/22 00:56:50 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 bool bVerboseLogging, bool bStartupTips);
117 virtual ~DialogPreferences ();
119 bool getAdvancedOptions ();
120 bool getAskDeleteNewDocs ();
121 bool getVerboseLogging ();
122 bool getStartupTips ();
125 wxCheckBox* m_pCBAdvancedOptions;
126 wxCheckBox* m_pCBAskDeleteNewDocs;
127 wxCheckBox* m_pCBVerboseLogging;
128 wxCheckBox* m_pCBStartupTips;
133 class DialogGetMinMax : public wxDialog
136 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
137 virtual ~DialogGetMinMax ();
139 double getMinimum ();
140 double getMaximum ();
143 wxTextCtrl* m_pTextCtrlMin;
144 wxTextCtrl* m_pTextCtrlMax;
146 double m_dDefaultMin;
147 double m_dDefaultMax;
151 class DialogGetRasterParameters : public wxDialog
154 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
155 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
156 virtual ~DialogGetRasterParameters ();
158 unsigned int getXSize ();
159 unsigned int getYSize ();
160 unsigned int getNSamples ();
161 double getViewRatio();
164 wxTextCtrl* m_pTextCtrlXSize;
165 wxTextCtrl* m_pTextCtrlYSize;
166 wxTextCtrl* m_pTextCtrlNSamples;
167 wxTextCtrl* m_pTextCtrlViewRatio;
171 int m_iDefaultNSamples;
172 double m_dDefaultViewRatio;
176 class DialogGetProjectionParameters : public wxDialog
179 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
180 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
181 double dDefaultFocalLength = 1, double dDefaultViewRatio = 1.,
182 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
183 ~DialogGetProjectionParameters ();
185 unsigned int getNDet ();
186 unsigned int getNView ();
187 unsigned int getNSamples ();
190 double getRotAngle ();
191 double getViewRatio ();
192 double getScanRatio ();
193 double getFocalLengthRatio ();
194 const char* getGeometry();
197 wxTextCtrl* m_pTextCtrlNDet;
198 wxTextCtrl* m_pTextCtrlNView;
199 wxTextCtrl* m_pTextCtrlNSamples;
200 wxTextCtrl* m_pTextCtrlRotAngle;
201 wxTextCtrl* m_pTextCtrlFocalLength;
202 wxTextCtrl* m_pTextCtrlViewRatio;
203 wxTextCtrl* m_pTextCtrlScanRatio;
204 StringValueAndTitleRadioBox* m_pRadioBoxGeometry;
205 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
209 int m_iDefaultNSamples;
211 int m_iDefaultGeometry;
212 double m_dDefaultRotAngle;
213 double m_dDefaultFocalLength;
214 double m_dDefaultViewRatio;
215 double m_dDefaultScanRatio;
219 #include "backprojectors.h"
220 class DialogGetReconstructionParameters : public wxDialog
223 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
224 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
225 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
226 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
227 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
228 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
229 int iDefaultTrace = Trace::TRACE_NONE);
230 virtual ~DialogGetReconstructionParameters ();
232 unsigned int getXSize();
233 unsigned int getYSize();
234 const char* getFilterName();
235 double getFilterParam();
236 const char* getFilterMethodName();
237 unsigned int getZeropad();
238 const char* getFilterGenerationName();
239 const char* getInterpName();
240 unsigned int getInterpParam();
241 const char* getBackprojectName();
245 wxTextCtrl* m_pTextCtrlXSize;
246 wxTextCtrl* m_pTextCtrlYSize;
247 wxTextCtrl* m_pTextCtrlZeropad;
248 wxTextCtrl* m_pTextCtrlFilterParam;
249 wxTextCtrl* m_pTextCtrlInterpParam;
251 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
252 StringValueAndTitleRadioBox* m_pRadioBoxFilterMethod;
253 StringValueAndTitleRadioBox* m_pRadioBoxFilterGeneration;
254 StringValueAndTitleRadioBox* m_pRadioBoxInterp;
255 StringValueAndTitleRadioBox* m_pRadioBoxBackproject;
256 StringValueAndTitleRadioBox* m_pRadioBoxTrace;
260 double m_dDefaultFilterParam;
261 int m_iDefaultZeropad;
262 int m_iDefaultInterpParam;
267 class DialogGetFilterParameters : public wxDialog
270 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.);
271 virtual ~DialogGetFilterParameters ();
273 unsigned int getXSize();
274 unsigned int getYSize();
275 const char* getFilterName();
276 const char* getDomainName();
277 double getFilterParam();
278 double getInputScale();
279 double getOutputScale();
280 double getBandwidth();
283 wxTextCtrl* m_pTextCtrlXSize;
284 wxTextCtrl* m_pTextCtrlYSize;
285 wxTextCtrl* m_pTextCtrlFilterParam;
286 wxTextCtrl* m_pTextCtrlOutputScale;
287 wxTextCtrl* m_pTextCtrlInputScale;
288 wxTextCtrl* m_pTextCtrlBandwidth;
290 StringValueAndTitleRadioBox* m_pRadioBoxFilter;
291 StringValueAndTitleRadioBox* m_pRadioBoxDomain;
295 double m_dDefaultFilterParam;
296 double m_dDefaultBandwidth;
297 double m_dDefaultOutputScale;
298 double m_dDefaultInputScale;
299 int m_iDefaultDomain;
302 class DialogExportParameters : public wxDialog
305 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
306 virtual ~DialogExportParameters () {}
308 const char* getFormatName();
311 StringValueAndTitleRadioBox* m_pRadioBoxFormat;
314 class DialogAutoScaleParameters : public wxDialog
317 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
318 virtual ~DialogAutoScaleParameters() {}
320 bool getMinMax (double* pMin, double* pMax);
321 double getAutoScaleFactor ();
324 const double m_dMean;
325 const double m_dMode;
326 const double m_dMedian;
327 const double m_dStdDev;
329 wxTextCtrl* m_pTextCtrlStdDevFactor;
330 wxRadioBox* m_pRadioBoxCenter;
333 class DialogGetXYSize : public wxDialog
336 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
337 virtual ~DialogGetXYSize ();
339 unsigned int getXSize ();
340 unsigned int getYSize ();
343 wxTextCtrl* m_pTextCtrlXSize;
344 wxTextCtrl* m_pTextCtrlYSize;
346 unsigned int m_iDefaultXSize;
347 unsigned int m_iDefaultYSize;
351 class DialogGetConvertPolarParameters : public wxDialog
354 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
355 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
356 int iDefaultZeropad = 1);
357 virtual ~DialogGetConvertPolarParameters ();
359 unsigned int getXSize();
360 unsigned int getYSize();
361 const char* getInterpolationName();
362 unsigned int getZeropad();
365 wxTextCtrl* m_pTextCtrlXSize;
366 wxTextCtrl* m_pTextCtrlYSize;
367 wxTextCtrl* m_pTextCtrlZeropad;
369 StringValueAndTitleRadioBox* m_pRadioBoxInterpolation;
373 int m_iDefaultZeropad;