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.25 2001/02/11 21:57:08 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 StringValueAndTitleListBox
44 // A superclass of wxListBox that can handle string values and titles
45 // and by displaying the title in the list box and returning the string value
47 class StringValueAndTitleListBox : public wxListBox
50 StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
52 const char* getSelectionStringValue () const;
55 const char** m_ppszValues;
59 class DialogGetPhantom : public wxDialog
62 DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
63 virtual ~DialogGetPhantom () {}
65 const char* getPhantom ();
68 StringValueAndTitleListBox* m_pListBoxPhantom;
73 class ImageFileDocument;
74 class DialogGetComparisonImage : public wxDialog
77 DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
78 virtual ~DialogGetComparisonImage () {}
80 ImageFileDocument* getImageFileDocument ();
82 bool getMakeDifferenceImage();
85 wxListBox* m_pListBoxImageChoices;
86 wxCheckBox* m_pMakeDifferenceImage;
87 const std::vector<ImageFileDocument*>& m_rVecIF;
91 class DialogPreferences : public wxDialog
94 DialogPreferences (wxWindow* pParent, const char* const pszTitle, bool bAdvanced, bool bAskNewDocs);
95 virtual ~DialogPreferences ();
97 bool getAdvancedOptions ();
98 bool getAskDeleteNewDocs ();
101 wxCheckBox* m_pCBAdvancedOptions;
102 wxCheckBox* m_pCBAskDeleteNewDocs;
107 class DialogGetMinMax : public wxDialog
110 DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
111 virtual ~DialogGetMinMax ();
113 double getMinimum ();
114 double getMaximum ();
117 wxTextCtrl* m_pTextCtrlMin;
118 wxTextCtrl* m_pTextCtrlMax;
120 double m_dDefaultMin;
121 double m_dDefaultMax;
125 class DialogGetRasterParameters : public wxDialog
128 DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
129 int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
130 virtual ~DialogGetRasterParameters ();
132 unsigned int getXSize ();
133 unsigned int getYSize ();
134 unsigned int getNSamples ();
135 double getViewRatio();
138 wxTextCtrl* m_pTextCtrlXSize;
139 wxTextCtrl* m_pTextCtrlYSize;
140 wxTextCtrl* m_pTextCtrlNSamples;
141 wxTextCtrl* m_pTextCtrlViewRatio;
145 int m_iDefaultNSamples;
146 double m_dDefaultViewRatio;
150 class DialogGetProjectionParameters : public wxDialog
153 DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0,
154 int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1.,
155 double dDefaultFocalLength = 1, double dDefaultViewRatio = 1.,
156 double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
157 ~DialogGetProjectionParameters ();
159 unsigned int getNDet ();
160 unsigned int getNView ();
161 unsigned int getNSamples ();
164 double getRotAngle ();
165 double getViewRatio ();
166 double getScanRatio ();
167 double getFocalLengthRatio ();
168 const char* getGeometry();
171 wxTextCtrl* m_pTextCtrlNDet;
172 wxTextCtrl* m_pTextCtrlNView;
173 wxTextCtrl* m_pTextCtrlNSamples;
174 wxTextCtrl* m_pTextCtrlRotAngle;
175 wxTextCtrl* m_pTextCtrlFocalLength;
176 wxTextCtrl* m_pTextCtrlViewRatio;
177 wxTextCtrl* m_pTextCtrlScanRatio;
178 StringValueAndTitleListBox* m_pListBoxGeometry;
179 StringValueAndTitleListBox* m_pListBoxTrace;
183 int m_iDefaultNSamples;
185 int m_iDefaultGeometry;
186 double m_dDefaultRotAngle;
187 double m_dDefaultFocalLength;
188 double m_dDefaultViewRatio;
189 double m_dDefaultScanRatio;
193 #include "backprojectors.h"
194 class DialogGetReconstructionParameters : public wxDialog
197 DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0,
198 int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1.,
199 int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION,
200 int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT,
201 int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR,
202 int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF,
203 int iDefaultTrace = Trace::TRACE_NONE);
204 virtual ~DialogGetReconstructionParameters ();
206 unsigned int getXSize();
207 unsigned int getYSize();
208 const char* getFilterName();
209 double getFilterParam();
210 const char* getFilterMethodName();
211 unsigned int getZeropad();
212 const char* getFilterGenerationName();
213 const char* getInterpName();
214 unsigned int getInterpParam();
215 const char* getBackprojectName();
219 wxTextCtrl* m_pTextCtrlXSize;
220 wxTextCtrl* m_pTextCtrlYSize;
221 wxTextCtrl* m_pTextCtrlZeropad;
222 wxTextCtrl* m_pTextCtrlFilterParam;
223 wxTextCtrl* m_pTextCtrlInterpParam;
225 StringValueAndTitleListBox* m_pListBoxFilter;
226 StringValueAndTitleListBox* m_pListBoxFilterMethod;
227 StringValueAndTitleListBox* m_pListBoxFilterGeneration;
228 StringValueAndTitleListBox* m_pListBoxInterp;
229 StringValueAndTitleListBox* m_pListBoxBackproject;
230 StringValueAndTitleListBox* m_pListBoxTrace;
234 double m_dDefaultFilterParam;
235 int m_iDefaultZeropad;
236 int m_iDefaultInterpParam;
241 class DialogGetFilterParameters : public wxDialog
244 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.);
245 virtual ~DialogGetFilterParameters ();
247 unsigned int getXSize();
248 unsigned int getYSize();
249 const char* getFilterName();
250 const char* getDomainName();
251 double getFilterParam();
252 double getInputScale();
253 double getOutputScale();
254 double getBandwidth();
257 wxTextCtrl* m_pTextCtrlXSize;
258 wxTextCtrl* m_pTextCtrlYSize;
259 wxTextCtrl* m_pTextCtrlFilterParam;
260 wxTextCtrl* m_pTextCtrlOutputScale;
261 wxTextCtrl* m_pTextCtrlInputScale;
262 wxTextCtrl* m_pTextCtrlBandwidth;
264 StringValueAndTitleListBox* m_pListBoxFilter;
265 StringValueAndTitleListBox* m_pListBoxDomain;
269 double m_dDefaultFilterParam;
270 double m_dDefaultBandwidth;
271 double m_dDefaultOutputScale;
272 double m_dDefaultInputScale;
273 int m_iDefaultDomain;
276 class DialogExportParameters : public wxDialog
279 DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
280 virtual ~DialogExportParameters () {}
282 const char* getFormatName();
285 StringValueAndTitleListBox* m_pListBoxFormat;
288 class DialogAutoScaleParameters : public wxDialog
291 DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
292 virtual ~DialogAutoScaleParameters() {}
294 bool getMinMax (double* pMin, double* pMax);
295 double getAutoScaleFactor ();
298 const double m_dMean;
299 const double m_dMode;
300 const double m_dMedian;
301 const double m_dStdDev;
303 wxTextCtrl* m_pTextCtrlStdDevFactor;
304 wxListBox* m_pListBoxCenter;
307 class DialogGetXYSize : public wxDialog
310 DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
311 virtual ~DialogGetXYSize ();
313 unsigned int getXSize ();
314 unsigned int getYSize ();
317 wxTextCtrl* m_pTextCtrlXSize;
318 wxTextCtrl* m_pTextCtrlYSize;
320 unsigned int m_iDefaultXSize;
321 unsigned int m_iDefaultYSize;
325 class DialogGetConvertPolarParameters : public wxDialog
328 DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0,
329 int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR,
330 int iDefaultZeropad = 1);
331 virtual ~DialogGetConvertPolarParameters ();
333 unsigned int getXSize();
334 unsigned int getYSize();
335 const char* getInterpolationName();
336 unsigned int getZeropad();
339 wxTextCtrl* m_pTextCtrlXSize;
340 wxTextCtrl* m_pTextCtrlYSize;
341 wxTextCtrl* m_pTextCtrlZeropad;
343 StringValueAndTitleListBox* m_pListBoxInterpolation;
347 int m_iDefaultZeropad;