r311: image comparison functions
[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-2000 Kevin Rosenberg
11 **
12 **  $Id: dialogs.h,v 1.16 2000/12/22 04:18:00 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"\r
39
40
41 // CLASS StringValueAndTitleListBox
42 //
43 // A superclass of wxListBox that can handle string values and titles
44 // and by displaying the title in the list box and returning the string value
45
46 class StringValueAndTitleListBox : public wxListBox
47 {
48  public:
49   StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
50
51     const char* getSelectionStringValue () const;
52
53  private:
54     const char** m_ppszValues;
55 };
56
57
58 class DialogGetPhantom : public wxDialog
59 {
60  public:
61     DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
62     virtual ~DialogGetPhantom () {}
63
64     const char* getPhantom ();
65
66  private:
67     StringValueAndTitleListBox* m_pListBoxPhantom;
68 };
69 \r
70 \r
71 #include <vector>\r
72 class ImageFileDocument;\r
73 class DialogGetComparisonImage : public wxDialog\r
74 {\r
75  public:\r
76    DialogGetComparisonImage (wxFrame* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference);\r
77     virtual ~DialogGetComparisonImage () {}\r
78 \r
79     ImageFileDocument* getImageFileDocument ();\r
80 \r
81     bool getMakeDifferenceImage();\r
82 \r
83  private:\r
84     wxListBox* m_pListBoxImageChoices;\r
85     wxCheckBox* m_pMakeDifferenceImage;\r
86     const std::vector<ImageFileDocument*>& m_rVecIF;\r
87 };\r
88 \r
89
90
91 class ImageFile;
92 class DialogGetMinMax : public wxDialog
93 {
94  public:
95     DialogGetMinMax (wxFrame* 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 (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1);
114     virtual ~DialogGetRasterParameters ();
115
116     unsigned int getXSize ();
117     unsigned int getYSize ();
118     unsigned int getNSamples ();
119
120  private:
121     wxTextCtrl* m_pTextCtrlXSize;
122     wxTextCtrl* m_pTextCtrlYSize;
123     wxTextCtrl* m_pTextCtrlNSamples;
124
125     int m_iDefaultXSize;
126     int m_iDefaultYSize;
127     int m_iDefaultNSamples;
128 };
129
130
131 class DialogGetProjectionParameters : public wxDialog
132 {
133  public:
134     DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet = 0, int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1., double dDefaultFocalLength = 1, double dDefaultFieldOfView = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
135     ~DialogGetProjectionParameters ();
136
137     unsigned int getNDet ();
138     unsigned int getNView ();
139     unsigned int getNSamples ();
140     int getTrace ();
141
142     double getRotAngle ();
143     double getFieldOfViewRatio ();
144     double getFocalLengthRatio ();
145     const char* getGeometry();
146
147  private:
148     wxTextCtrl* m_pTextCtrlNDet;
149     wxTextCtrl* m_pTextCtrlNView;
150     wxTextCtrl* m_pTextCtrlNSamples;
151     wxTextCtrl* m_pTextCtrlRotAngle;
152     wxTextCtrl* m_pTextCtrlFocalLength;
153     wxTextCtrl* m_pTextCtrlFieldOfView;
154
155     StringValueAndTitleListBox* m_pListBoxGeometry;
156     StringValueAndTitleListBox* m_pListBoxTrace;
157
158     int m_iDefaultNDet;
159     int m_iDefaultNView;
160     int m_iDefaultNSamples;
161     int m_iDefaultTrace;
162     int m_iDefaultGeometry;
163     double m_dDefaultRotAngle;
164     double m_dDefaultFocalLength;
165     double m_dDefaultFieldOfView;
166 };
167
168
169 #include "backprojectors.h"
170 class DialogGetReconstructionParameters : public wxDialog
171 {
172  public:
173     DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1., int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION, int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_INVALID, int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR, int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF3, int iDefaultTrace = Trace::TRACE_NONE);
174     virtual ~DialogGetReconstructionParameters ();
175
176     unsigned int getXSize();
177     unsigned int getYSize();
178     const char* getFilterName();
179     double getFilterParam();
180     const char* getFilterMethodName();
181     unsigned int getZeropad();
182     const char* getFilterGenerationName();
183     const char* getInterpName();
184     unsigned int getInterpParam();
185     const char* getBackprojectName();
186     int getTrace ();
187
188  private:
189     wxTextCtrl* m_pTextCtrlXSize;
190     wxTextCtrl* m_pTextCtrlYSize;
191     wxTextCtrl* m_pTextCtrlZeropad;
192     wxTextCtrl* m_pTextCtrlFilterParam;
193     wxTextCtrl* m_pTextCtrlInterpParam;
194
195     StringValueAndTitleListBox* m_pListBoxFilter;
196     StringValueAndTitleListBox* m_pListBoxFilterMethod;
197     StringValueAndTitleListBox* m_pListBoxFilterGeneration;
198     StringValueAndTitleListBox* m_pListBoxInterp;
199     StringValueAndTitleListBox* m_pListBoxBackproject;
200     StringValueAndTitleListBox* m_pListBoxTrace;
201
202     int m_iDefaultXSize;
203     int m_iDefaultYSize;
204     double m_dDefaultFilterParam;
205     int m_iDefaultZeropad;
206     int m_iDefaultInterpParam;
207     int m_iDefaultTrace;
208 };
209
210 class DialogAutoScaleParameters : public wxDialog
211 {
212  public:
213     DialogAutoScaleParameters (wxFrame* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
214     virtual ~DialogAutoScaleParameters() {}
215
216     bool getMinMax (double* pMin, double* pMax);
217     double getAutoScaleFactor ();
218
219  private:
220     const double m_dMean;\r
221         const double m_dMode;
222         const double m_dMedian;\r
223         const double m_dStdDev;\r
224
225     wxTextCtrl* m_pTextCtrlStdDevFactor;
226     wxListBox* m_pListBoxCenter;
227 };
228
229 #endif
230