r310: plotfile updates
[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.15 2000/12/21 03:40:58 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
71
72 class ImageFile;
73 class DialogGetMinMax : public wxDialog
74 {
75  public:
76     DialogGetMinMax (wxFrame* pParent, const char* const pszTitle, double dDefaultMin = 0., double dDefaultMax = 0.);
77     virtual ~DialogGetMinMax ();
78
79     double getMinimum ();
80     double getMaximum ();
81
82  private:
83     wxTextCtrl* m_pTextCtrlMin;
84     wxTextCtrl* m_pTextCtrlMax;
85
86     double m_dDefaultMin;
87     double m_dDefaultMax;
88 };
89
90
91 class DialogGetRasterParameters : public wxDialog
92 {
93  public:
94     DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1);
95     virtual ~DialogGetRasterParameters ();
96
97     unsigned int getXSize ();
98     unsigned int getYSize ();
99     unsigned int getNSamples ();
100
101  private:
102     wxTextCtrl* m_pTextCtrlXSize;
103     wxTextCtrl* m_pTextCtrlYSize;
104     wxTextCtrl* m_pTextCtrlNSamples;
105
106     int m_iDefaultXSize;
107     int m_iDefaultYSize;
108     int m_iDefaultNSamples;
109 };
110
111
112 class DialogGetProjectionParameters : public wxDialog
113 {
114  public:
115     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);
116     ~DialogGetProjectionParameters ();
117
118     unsigned int getNDet ();
119     unsigned int getNView ();
120     unsigned int getNSamples ();
121     int getTrace ();
122
123     double getRotAngle ();
124     double getFieldOfViewRatio ();
125     double getFocalLengthRatio ();
126     const char* getGeometry();
127
128  private:
129     wxTextCtrl* m_pTextCtrlNDet;
130     wxTextCtrl* m_pTextCtrlNView;
131     wxTextCtrl* m_pTextCtrlNSamples;
132     wxTextCtrl* m_pTextCtrlRotAngle;
133     wxTextCtrl* m_pTextCtrlFocalLength;
134     wxTextCtrl* m_pTextCtrlFieldOfView;
135
136     StringValueAndTitleListBox* m_pListBoxGeometry;
137     StringValueAndTitleListBox* m_pListBoxTrace;
138
139     int m_iDefaultNDet;
140     int m_iDefaultNView;
141     int m_iDefaultNSamples;
142     int m_iDefaultTrace;
143     int m_iDefaultGeometry;
144     double m_dDefaultRotAngle;
145     double m_dDefaultFocalLength;
146     double m_dDefaultFieldOfView;
147 };
148
149
150 #include "backprojectors.h"
151 class DialogGetReconstructionParameters : public wxDialog
152 {
153  public:
154     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);
155     virtual ~DialogGetReconstructionParameters ();
156
157     unsigned int getXSize();
158     unsigned int getYSize();
159     const char* getFilterName();
160     double getFilterParam();
161     const char* getFilterMethodName();
162     unsigned int getZeropad();
163     const char* getFilterGenerationName();
164     const char* getInterpName();
165     unsigned int getInterpParam();
166     const char* getBackprojectName();
167     int getTrace ();
168
169  private:
170     wxTextCtrl* m_pTextCtrlXSize;
171     wxTextCtrl* m_pTextCtrlYSize;
172     wxTextCtrl* m_pTextCtrlZeropad;
173     wxTextCtrl* m_pTextCtrlFilterParam;
174     wxTextCtrl* m_pTextCtrlInterpParam;
175
176     StringValueAndTitleListBox* m_pListBoxFilter;
177     StringValueAndTitleListBox* m_pListBoxFilterMethod;
178     StringValueAndTitleListBox* m_pListBoxFilterGeneration;
179     StringValueAndTitleListBox* m_pListBoxInterp;
180     StringValueAndTitleListBox* m_pListBoxBackproject;
181     StringValueAndTitleListBox* m_pListBoxTrace;
182
183     int m_iDefaultXSize;
184     int m_iDefaultYSize;
185     double m_dDefaultFilterParam;
186     int m_iDefaultZeropad;
187     int m_iDefaultInterpParam;
188     int m_iDefaultTrace;
189 };
190
191 class DialogAutoScaleParameters : public wxDialog
192 {
193  public:
194     DialogAutoScaleParameters (wxFrame* pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor = 1.);
195     virtual ~DialogAutoScaleParameters() {}
196
197     bool getMinMax (double* pMin, double* pMax);
198     double getAutoScaleFactor ();
199
200  private:
201     const double m_dMean;\r
202         const double m_dMode;
203         const double m_dMedian;\r
204         const double m_dStdDev;\r
205
206     wxTextCtrl* m_pTextCtrlStdDevFactor;
207     wxListBox* m_pListBoxCenter;
208 };
209
210 #endif
211