e4f890cbd44e8b491812db9d053416badcf2d7e1
[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.9 2000/08/22 07:02:48 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., 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     const char* getGeometry(void);
120
121  private:
122     wxTextCtrl* m_pTextCtrlNDet;
123     wxTextCtrl* m_pTextCtrlNView;
124     wxTextCtrl* m_pTextCtrlNSamples;
125     wxTextCtrl* m_pTextCtrlRotAngle;
126
127     StringValueAndTitleListBox* m_pListBoxGeometry;
128
129     int m_iDefaultNDet;
130     int m_iDefaultNView;
131     int m_iDefaultNSamples;
132     double m_dDefaultRotAngle;
133 };
134
135
136 #include "backprojectors.h"
137 class DialogGetReconstructionParameters : public wxDialog
138 {
139  public:
140     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);
141     virtual ~DialogGetReconstructionParameters (void);
142
143     unsigned int getXSize(void);
144     unsigned int getYSize(void);
145     const char* getFilterName(void);
146     double getFilterParam(void);
147     const char* getFilterMethodName(void);
148     unsigned int getZeropad(void);
149     const char* getFilterGenerationName(void);
150     const char* getInterpName(void);
151     unsigned int getInterpParam(void);
152     const char* getBackprojectName(void);
153
154  private:
155     wxTextCtrl* m_pTextCtrlXSize;
156     wxTextCtrl* m_pTextCtrlYSize;
157     wxTextCtrl* m_pTextCtrlZeropad;
158     wxTextCtrl* m_pTextCtrlFilterParam;
159     wxTextCtrl* m_pTextCtrlInterpParam;
160
161     StringValueAndTitleListBox* m_pListBoxFilter;
162     StringValueAndTitleListBox* m_pListBoxFilterMethod;
163     StringValueAndTitleListBox* m_pListBoxFilterGeneration;
164     StringValueAndTitleListBox* m_pListBoxInterp;
165     StringValueAndTitleListBox* m_pListBoxBackproject;
166
167     int m_iDefaultXSize;
168     int m_iDefaultYSize;
169     double m_dDefaultFilterParam;
170     int m_iDefaultZeropad;
171     int m_iDefaultInterpParam;
172 };
173
174 #endif
175