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