7271339bd9a8c789e254157e8e22b38ffef5d948
[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.12 2000/08/31 08:38: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"
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 (void) 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 (void) {}
62
63     const char* getPhantom (void);
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 (void);
76
77     double getMinimum (void);
78     double getMaximum (void);
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 (void);
94
95     unsigned int getXSize (void);
96     unsigned int getYSize (void);
97     unsigned int getNSamples (void);
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 (void);
115
116     unsigned int getNDet (void);
117     unsigned int getNView (void);
118     unsigned int getNSamples (void);
119     int getTrace (void);
120
121     double getRotAngle (void);
122     double getFieldOfViewRatio (void);
123     double getFocalLengthRatio (void);
124     const char* getGeometry(void);
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     double m_dDefaultRotAngle;
142     double m_dDefaultFocalLength;
143     double m_dDefaultFieldOfView;
144 };
145
146
147 #include "backprojectors.h"
148 class DialogGetReconstructionParameters : public wxDialog
149 {
150  public:
151     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);
152     virtual ~DialogGetReconstructionParameters (void);
153
154     unsigned int getXSize(void);
155     unsigned int getYSize(void);
156     const char* getFilterName(void);
157     double getFilterParam(void);
158     const char* getFilterMethodName(void);
159     unsigned int getZeropad(void);
160     const char* getFilterGenerationName(void);
161     const char* getInterpName(void);
162     unsigned int getInterpParam(void);
163     const char* getBackprojectName(void);
164
165  private:
166     wxTextCtrl* m_pTextCtrlXSize;
167     wxTextCtrl* m_pTextCtrlYSize;
168     wxTextCtrl* m_pTextCtrlZeropad;
169     wxTextCtrl* m_pTextCtrlFilterParam;
170     wxTextCtrl* m_pTextCtrlInterpParam;
171
172     StringValueAndTitleListBox* m_pListBoxFilter;
173     StringValueAndTitleListBox* m_pListBoxFilterMethod;
174     StringValueAndTitleListBox* m_pListBoxFilterGeneration;
175     StringValueAndTitleListBox* m_pListBoxInterp;
176     StringValueAndTitleListBox* m_pListBoxBackproject;
177
178     int m_iDefaultXSize;
179     int m_iDefaultYSize;
180     double m_dDefaultFilterParam;
181     int m_iDefaultZeropad;
182     int m_iDefaultInterpParam;
183 };
184
185 class DialogAutoScaleParameters : public wxDialog
186 {
187  public:
188     DialogAutoScaleParameters (wxFrame* pParent, const ImageFile& rImageFile, double dDefaultScaleFactor = 1.);
189     virtual ~DialogAutoScaleParameters() {}
190
191     void getMinMax (double* pMin, double* pMax);
192     double getAutoScaleFactor ();
193
194  private:
195     const ImageFile& m_rImageFile;
196
197     wxTextCtrl* m_pTextCtrlStdDevFactor;
198     wxListBox* m_pListBoxCenter;
199 };
200
201 #endif
202