r520: no message
[ctsim.git] / src / dialogs.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          dialogs.h
5 **   Purpose:       Header file for Dialogs of CTSim program
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  July 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (c) 1983-2001 Kevin Rosenberg
11 **
12 **  $Id: dialogs.h,v 1.24 2001/02/11 04:56:38 kevin Exp $
13 **
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.
17 **
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.
22 **
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 ******************************************************************************/
27
28
29 #ifndef __DIALOGSH__
30 #define __DIALOGSH__
31
32 #include "wx/wx.h"
33 #include <string>
34 #include "ctsupport.h"
35 #include "scanner.h"
36 #include "phantom.h"
37 #include "procsignal.h"
38 #include "filter.h"
39 #include "projections.h"
40
41
42 // CLASS StringValueAndTitleListBox
43 //
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
46
47 class StringValueAndTitleListBox : public wxListBox
48 {
49  public:
50   StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
51
52     const char* getSelectionStringValue () const;
53
54  private:
55     const char** m_ppszValues;
56 };
57
58
59 class DialogGetPhantom : public wxDialog
60 {
61  public:
62     DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
63     virtual ~DialogGetPhantom () {}
64
65     const char* getPhantom ();
66
67  private:
68     StringValueAndTitleListBox* m_pListBoxPhantom;
69 };
70
71
72 #include <vector>
73 class ImageFileDocument;
74 class DialogGetComparisonImage : public wxDialog
75 {
76  public:
77    DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);
78     virtual ~DialogGetComparisonImage () {}
79
80     ImageFileDocument* getImageFileDocument ();
81
82     bool getMakeDifferenceImage();
83
84  private:
85     wxListBox* m_pListBoxImageChoices;
86     wxCheckBox* m_pMakeDifferenceImage;
87     const std::vector<ImageFileDocument*>& m_rVecIF;
88 };
89
90
91 class ImageFile;
92 class DialogGetMinMax : public wxDialog
93 {
94  public:
95     DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
96     virtual ~DialogGetMinMax ();
97
98     double getMinimum ();
99     double getMaximum ();
100
101  private:
102     wxTextCtrl* m_pTextCtrlMin;
103     wxTextCtrl* m_pTextCtrlMax;
104
105     double m_dDefaultMin;
106     double m_dDefaultMax;
107 };
108
109
110 class DialogGetRasterParameters : public wxDialog
111 {
112  public:
113     DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, 
114       int iDefaultNSamples = 1, double dDefaultViewRatio = 1);
115     virtual ~DialogGetRasterParameters ();
116
117     unsigned int getXSize ();
118     unsigned int getYSize ();
119     unsigned int getNSamples ();
120     double getViewRatio();
121
122  private:
123     wxTextCtrl* m_pTextCtrlXSize;
124     wxTextCtrl* m_pTextCtrlYSize;
125     wxTextCtrl* m_pTextCtrlNSamples;
126     wxTextCtrl* m_pTextCtrlViewRatio;
127
128     int m_iDefaultXSize;
129     int m_iDefaultYSize;
130     int m_iDefaultNSamples;
131     double m_dDefaultViewRatio;
132 };
133
134
135 class DialogGetProjectionParameters : public wxDialog
136 {
137  public:
138     DialogGetProjectionParameters (wxWindow* pParent, int iDefaultNDet = 0, 
139       int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1., 
140       double dDefaultFocalLength = 1, double dDefaultViewRatio = 1., 
141       double dDefaultScanRatio = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
142     ~DialogGetProjectionParameters ();
143
144     unsigned int getNDet ();
145     unsigned int getNView ();
146     unsigned int getNSamples ();
147     int getTrace ();
148
149     double getRotAngle ();
150     double getViewRatio ();
151     double getScanRatio ();
152     double getFocalLengthRatio ();
153     const char* getGeometry();
154
155  private:
156     wxTextCtrl* m_pTextCtrlNDet;
157     wxTextCtrl* m_pTextCtrlNView;
158     wxTextCtrl* m_pTextCtrlNSamples;
159     wxTextCtrl* m_pTextCtrlRotAngle;
160     wxTextCtrl* m_pTextCtrlFocalLength;
161     wxTextCtrl* m_pTextCtrlViewRatio;
162     wxTextCtrl* m_pTextCtrlScanRatio;
163     StringValueAndTitleListBox* m_pListBoxGeometry;
164     StringValueAndTitleListBox* m_pListBoxTrace;
165
166     int m_iDefaultNDet;
167     int m_iDefaultNView;
168     int m_iDefaultNSamples;
169     int m_iDefaultTrace;
170     int m_iDefaultGeometry;
171     double m_dDefaultRotAngle;
172     double m_dDefaultFocalLength;
173     double m_dDefaultViewRatio;
174     double m_dDefaultScanRatio;
175 };
176
177
178 #include "backprojectors.h"
179 class DialogGetReconstructionParameters : public wxDialog
180 {
181  public:
182     DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, 
183       int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1., 
184       int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION, 
185       int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT, 
186       int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR, 
187       int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF, 
188       int iDefaultTrace = Trace::TRACE_NONE);
189     virtual ~DialogGetReconstructionParameters ();
190
191     unsigned int getXSize();
192     unsigned int getYSize();
193     const char* getFilterName();
194     double getFilterParam();
195     const char* getFilterMethodName();
196     unsigned int getZeropad();
197     const char* getFilterGenerationName();
198     const char* getInterpName();
199     unsigned int getInterpParam();
200     const char* getBackprojectName();
201     int getTrace ();
202
203  private:
204     wxTextCtrl* m_pTextCtrlXSize;
205     wxTextCtrl* m_pTextCtrlYSize;
206     wxTextCtrl* m_pTextCtrlZeropad;
207     wxTextCtrl* m_pTextCtrlFilterParam;
208     wxTextCtrl* m_pTextCtrlInterpParam;
209
210     StringValueAndTitleListBox* m_pListBoxFilter;
211     StringValueAndTitleListBox* m_pListBoxFilterMethod;
212     StringValueAndTitleListBox* m_pListBoxFilterGeneration;
213     StringValueAndTitleListBox* m_pListBoxInterp;
214     StringValueAndTitleListBox* m_pListBoxBackproject;
215     StringValueAndTitleListBox* m_pListBoxTrace;
216
217     int m_iDefaultXSize;
218     int m_iDefaultYSize;
219     double m_dDefaultFilterParam;
220     int m_iDefaultZeropad;
221     int m_iDefaultInterpParam;
222     int m_iDefaultTrace;
223 };
224
225
226 class DialogGetFilterParameters : public wxDialog
227 {
228  public:
229     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.);
230     virtual ~DialogGetFilterParameters ();
231
232     unsigned int getXSize();
233     unsigned int getYSize();
234     const char* getFilterName();
235     const char* getDomainName();
236     double getFilterParam();
237     double getInputScale();
238     double getOutputScale();
239     double getBandwidth();
240
241  private:
242     wxTextCtrl* m_pTextCtrlXSize;
243     wxTextCtrl* m_pTextCtrlYSize;
244     wxTextCtrl* m_pTextCtrlFilterParam;
245     wxTextCtrl* m_pTextCtrlOutputScale;
246     wxTextCtrl* m_pTextCtrlInputScale;
247     wxTextCtrl* m_pTextCtrlBandwidth;
248
249     StringValueAndTitleListBox* m_pListBoxFilter;
250     StringValueAndTitleListBox* m_pListBoxDomain;
251
252     int m_iDefaultXSize;
253     int m_iDefaultYSize;
254     double m_dDefaultFilterParam;
255     double m_dDefaultBandwidth;
256     double m_dDefaultOutputScale;
257     double m_dDefaultInputScale;
258     int m_iDefaultDomain;
259 };
260
261 class DialogExportParameters : public wxDialog
262 {
263  public:
264     DialogExportParameters (wxWindow* pParent, int iDefaultFormatID);
265     virtual ~DialogExportParameters () {}
266
267     const char* getFormatName();
268
269  private:
270     StringValueAndTitleListBox* m_pListBoxFormat;
271 };
272
273 class DialogAutoScaleParameters : public wxDialog
274 {
275  public:
276     DialogAutoScaleParameters (wxWindow* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
277     virtual ~DialogAutoScaleParameters() {}
278
279     bool getMinMax (double* pMin, double* pMax);
280     double getAutoScaleFactor ();
281
282  private:
283     const double m_dMean;
284         const double m_dMode;
285         const double m_dMedian;
286         const double m_dStdDev;
287
288     wxTextCtrl* m_pTextCtrlStdDevFactor;
289     wxListBox* m_pListBoxCenter;
290 };
291
292 class DialogGetXYSize : public wxDialog
293 {
294  public:
295     DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 1, int iDefaultYSize = 1);
296     virtual ~DialogGetXYSize ();
297
298     unsigned int getXSize ();
299     unsigned int getYSize ();
300
301  private:
302     wxTextCtrl* m_pTextCtrlXSize;
303     wxTextCtrl* m_pTextCtrlYSize;
304
305     unsigned int m_iDefaultXSize;
306     unsigned int m_iDefaultYSize;
307 };
308
309
310 class DialogGetConvertPolarParameters : public wxDialog
311 {
312  public:
313    DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize = 0, 
314      int iDefaultYSize = 0, int iDefaultInterpolationID = Projections::POLAR_INTERP_BILINEAR, 
315      int iDefaultZeropad = 1);
316    virtual ~DialogGetConvertPolarParameters ();
317
318     unsigned int getXSize();
319     unsigned int getYSize();
320     const char* getInterpolationName();
321     unsigned int getZeropad();
322
323  private:
324     wxTextCtrl* m_pTextCtrlXSize;
325     wxTextCtrl* m_pTextCtrlYSize;
326     wxTextCtrl* m_pTextCtrlZeropad;
327
328     StringValueAndTitleListBox* m_pListBoxInterpolation;
329
330     int m_iDefaultXSize;
331     int m_iDefaultYSize;
332     int m_iDefaultZeropad;
333 };
334
335
336 #endif
337