r158: *** 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.6 2000/07/22 15:45:33 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 "filter.h"
37
38 // CLASS StringValueAndTitleListBox
39 //
40 // A superclass of wxListBox that can handle string values and titles
41 // and by displaying the title in the list box and returning the string value
42
43 class StringValueAndTitleListBox : public wxListBox
44 {
45  public:
46   StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
47
48     const char* getSelectionStringValue (void) const;
49
50  private:
51     const char** m_ppszValues;
52 };
53
54
55 class DialogGetPhantom : public wxDialog
56 {
57  public:
58     DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
59     virtual ~DialogGetPhantom (void) {}
60
61     const char* getPhantom (void);
62
63  private:
64     StringValueAndTitleListBox* m_pListBoxPhantom;
65 };
66
67
68 class ImageFile;
69 class DialogGetImageMinMax : public wxDialog
70 {
71  public:
72     DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin = 0., double dDefaultMax = 0.);
73     virtual ~DialogGetImageMinMax (void);
74
75     double getMinimum (void);
76     double getMaximum (void);
77
78  private:
79     wxTextCtrl* m_pTextCtrlMin;
80     wxTextCtrl* m_pTextCtrlMax;
81
82     double m_dDefaultMin;
83     double m_dDefaultMax;
84 };
85
86
87 class DialogGetRasterParameters : public wxDialog
88 {
89  public:
90     DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1);
91     virtual ~DialogGetRasterParameters (void);
92
93     unsigned int getXSize (void);
94     unsigned int getYSize (void);
95     unsigned int getNSamples (void);
96
97  private:
98     wxTextCtrl* m_pTextCtrlXSize;
99     wxTextCtrl* m_pTextCtrlYSize;
100     wxTextCtrl* m_pTextCtrlNSamples;
101
102     int m_iDefaultXSize;
103     int m_iDefaultYSize;
104     int m_iDefaultNSamples;
105 };
106
107
108 class DialogGetProjectionParameters : public wxDialog
109 {
110  public:
111     DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet = 0, int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL);
112     ~DialogGetProjectionParameters (void);
113
114     unsigned int getNDet (void);
115     unsigned int getNView (void);
116     unsigned int getNSamples (void);
117     double getRotAngle (void);
118     const char* getGeometry(void);
119
120  private:
121     wxTextCtrl* m_pTextCtrlNDet;
122     wxTextCtrl* m_pTextCtrlNView;
123     wxTextCtrl* m_pTextCtrlNSamples;
124     wxTextCtrl* m_pTextCtrlRotAngle;
125
126     StringValueAndTitleListBox* m_pListBoxGeometry;
127
128     int m_iDefaultNDet;
129     int m_iDefaultNView;
130     int m_iDefaultNSamples;
131     double m_dDefaultRotAngle;
132 };
133
134
135 class DialogGetReconstructionParameters : public wxDialog
136 {
137  public:
138     DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1., int iDefaultFilterMethodID = SignalFilter::FILTER_METHOD_CONVOLUTION, int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR, int iDefaultInterpParam = 1, int iDefaultBackprojID = Backprojector::BPROJ_IDIFF3);
139     virtual ~DialogGetReconstructionParameters (void);
140
141     unsigned int getXSize(void);
142     unsigned int getYSize(void);
143     const char* getFilterName(void);
144     double getFilterParam(void);
145     const char* getFilterMethodName(void);
146     unsigned int getZeropad(void);
147     const char* getInterpName(void);
148     unsigned int getInterpParam(void);
149     const char* getBackprojectName(void);
150
151  private:
152     wxTextCtrl* m_pTextCtrlXSize;
153     wxTextCtrl* m_pTextCtrlYSize;
154     wxTextCtrl* m_pTextCtrlZeropad;
155     wxTextCtrl* m_pTextCtrlFilterParam;
156     wxTextCtrl* m_pTextCtrlInterpParam;
157
158     StringValueAndTitleListBox* m_pListBoxFilter;
159     StringValueAndTitleListBox* m_pListBoxFilterMethod;
160     StringValueAndTitleListBox* m_pListBoxInterp;
161     StringValueAndTitleListBox* m_pListBoxBackproject;
162
163     int m_iDefaultXSize;
164     int m_iDefaultYSize;
165     double m_dDefaultFilterParam;
166     int m_iDefaultZeropad;
167     int m_iDefaultInterpParam;
168 };
169
170 #endif
171