r187: *** empty log 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-2000 Kevin Rosenberg
11 **
12 **  $Id: dialogs.h,v 1.13 2000/09/02 05:10:39 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
40 // CLASS StringValueAndTitleListBox
41 //
42 // A superclass of wxListBox that can handle string values and titles
43 // and by displaying the title in the list box and returning the string value
44
45 class StringValueAndTitleListBox : public wxListBox
46 {
47  public:
48   StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
49
50     const char* getSelectionStringValue () const;
51
52  private:
53     const char** m_ppszValues;
54 };
55
56
57 class DialogGetPhantom : public wxDialog
58 {
59  public:
60     DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
61     virtual ~DialogGetPhantom () {}
62
63     const char* getPhantom ();
64
65  private:
66     StringValueAndTitleListBox* m_pListBoxPhantom;
67 };
68
69
70 class ImageFile;
71 class DialogGetImageMinMax : public wxDialog
72 {
73  public:
74     DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin = 0., double dDefaultMax = 0.);
75     virtual ~DialogGetImageMinMax ();
76
77     double getMinimum ();
78     double getMaximum ();
79
80  private:
81     wxTextCtrl* m_pTextCtrlMin;
82     wxTextCtrl* m_pTextCtrlMax;
83
84     double m_dDefaultMin;
85     double m_dDefaultMax;
86 };
87
88
89 class DialogGetRasterParameters : public wxDialog
90 {
91  public:
92     DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1);
93     virtual ~DialogGetRasterParameters ();
94
95     unsigned int getXSize ();
96     unsigned int getYSize ();
97     unsigned int getNSamples ();
98
99  private:
100     wxTextCtrl* m_pTextCtrlXSize;
101     wxTextCtrl* m_pTextCtrlYSize;
102     wxTextCtrl* m_pTextCtrlNSamples;
103
104     int m_iDefaultXSize;
105     int m_iDefaultYSize;
106     int m_iDefaultNSamples;
107 };
108
109
110 class DialogGetProjectionParameters : public wxDialog
111 {
112  public:
113     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);
114     ~DialogGetProjectionParameters ();
115
116     unsigned int getNDet ();
117     unsigned int getNView ();
118     unsigned int getNSamples ();
119     int getTrace ();
120
121     double getRotAngle ();
122     double getFieldOfViewRatio ();
123     double getFocalLengthRatio ();
124     const char* getGeometry();
125
126  private:
127     wxTextCtrl* m_pTextCtrlNDet;
128     wxTextCtrl* m_pTextCtrlNView;
129     wxTextCtrl* m_pTextCtrlNSamples;
130     wxTextCtrl* m_pTextCtrlRotAngle;
131     wxTextCtrl* m_pTextCtrlFocalLength;
132     wxTextCtrl* m_pTextCtrlFieldOfView;
133
134     StringValueAndTitleListBox* m_pListBoxGeometry;
135     StringValueAndTitleListBox* m_pListBoxTrace;
136
137     int m_iDefaultNDet;
138     int m_iDefaultNView;
139     int m_iDefaultNSamples;
140     int m_iDefaultTrace;
141     int m_iDefaultGeometry;
142     double m_dDefaultRotAngle;
143     double m_dDefaultFocalLength;
144     double m_dDefaultFieldOfView;
145 };
146
147
148 #include "backprojectors.h"
149 class DialogGetReconstructionParameters : public wxDialog
150 {
151  public:
152     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);
153     virtual ~DialogGetReconstructionParameters ();
154
155     unsigned int getXSize();
156     unsigned int getYSize();
157     const char* getFilterName();
158     double getFilterParam();
159     const char* getFilterMethodName();
160     unsigned int getZeropad();
161     const char* getFilterGenerationName();
162     const char* getInterpName();
163     unsigned int getInterpParam();
164     const char* getBackprojectName();
165     int getTrace ();
166
167  private:
168     wxTextCtrl* m_pTextCtrlXSize;
169     wxTextCtrl* m_pTextCtrlYSize;
170     wxTextCtrl* m_pTextCtrlZeropad;
171     wxTextCtrl* m_pTextCtrlFilterParam;
172     wxTextCtrl* m_pTextCtrlInterpParam;
173
174     StringValueAndTitleListBox* m_pListBoxFilter;
175     StringValueAndTitleListBox* m_pListBoxFilterMethod;
176     StringValueAndTitleListBox* m_pListBoxFilterGeneration;
177     StringValueAndTitleListBox* m_pListBoxInterp;
178     StringValueAndTitleListBox* m_pListBoxBackproject;
179     StringValueAndTitleListBox* m_pListBoxTrace;
180
181     int m_iDefaultXSize;
182     int m_iDefaultYSize;
183     double m_dDefaultFilterParam;
184     int m_iDefaultZeropad;
185     int m_iDefaultInterpParam;
186     int m_iDefaultTrace;
187 };
188
189 class DialogAutoScaleParameters : public wxDialog
190 {
191  public:
192     DialogAutoScaleParameters (wxFrame* pParent, const ImageFile& rImageFile, double dDefaultScaleFactor = 1.);
193     virtual ~DialogAutoScaleParameters() {}
194
195     void getMinMax (double* pMin, double* pMax);
196     double getAutoScaleFactor ();
197
198  private:
199     const ImageFile& m_rImageFile;
200
201     wxTextCtrl* m_pTextCtrlStdDevFactor;
202     wxListBox* m_pListBoxCenter;
203 };
204
205 #endif
206