4b2738ff2111cac5f5ef58fff26540812a38dff5
[ctsim.git] / src / dialogs.cpp
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          dialogs.cpp
5 **   Purpose:       Dialog routines for 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.cpp,v 1.8 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 #ifdef __GNUG__
29 // #pragma implementation
30 #endif
31
32 // For compilers that support precompilation, includes "wx/wx.h".
33 #include "wx/wxprec.h"
34
35 #ifdef __BORLANDC__
36 #pragma hdrstop
37 #endif
38
39 #ifndef WX_PRECOMP
40 #include "wx/wx.h"
41 #endif
42
43 #if !wxUSE_DOC_VIEW_ARCHITECTURE
44 #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
45 #endif
46
47 #include "wx/statline.h"
48 #include "wx/sizer.h"
49 #include "dialogs.h"
50 #include <sstream>
51 #include "ctsupport.h"
52 #include "ctsim.h"
53 #include "scanner.h"
54 #include "phantom.h"
55 #include "filter.h"
56 #include "backprojectors.h"
57
58
59 StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[])
60   : wxListBox ()
61 {
62     wxString asTitle[nChoices];
63     for (int i = 0; i < nChoices; i++)
64         asTitle[i] = aszTitle[i];
65
66     Create (pParent, -1, wxDefaultPosition, wxDefaultSize, nChoices, asTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
67
68     m_ppszValues = aszValue;
69 };
70
71 const char*
72 StringValueAndTitleListBox::getSelectionStringValue (void) const
73 {
74   return m_ppszValues[GetSelection()];
75 }
76
77
78
79 DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN)
80     : wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
81 {
82   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
83
84   pTopSizer->Add (new wxStaticText (this, -1, "Select Phantom"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
85                    
86   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
87
88   m_pListBoxPhantom = new StringValueAndTitleListBox (this, Phantom::getPhantomCount(), Phantom::getPhantomTitleArray(), Phantom::getPhantomNameArray());
89   m_pListBoxPhantom->SetSelection (iDefaultPhantom);
90   pTopSizer->Add (m_pListBoxPhantom, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
91
92   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
93
94   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
95   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
96   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
97   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
98   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
99
100   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
101
102   SetAutoLayout (true);
103   SetSizer (pTopSizer);
104   pTopSizer->Fit (this);
105   pTopSizer->SetSizeHints (this);
106 }
107
108 const char*
109 DialogGetPhantom::getPhantom(void)
110 {
111     return m_pListBoxPhantom->getSelectionStringValue();
112 }
113
114
115 DialogGetImageMinMax::DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin = 0., double dDefaultMax = 0.)
116     : wxDialog (pParent, -1, "Set Image Display Minimum & Maximum", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
117 {
118   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
119
120   pTopSizer->Add (new wxStaticText (this, -1, "Set Image Display Minimum and Maximum"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
121                    
122   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
123
124   ostringstream os;
125   os << dDefaultMin;
126   m_pTextCtrlMin = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
127   ostringstream osMax;
128   osMax << dDefaultMax;
129   m_pTextCtrlMax = new wxTextCtrl (this, -1, osMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
130
131   wxGridSizer *pGridSizer = new wxGridSizer (2, 2, 5);
132   pGridSizer->Add (new wxStaticText (this, -1, "Minimum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
133   pGridSizer->Add (m_pTextCtrlMin, 0, wxALIGN_CENTER_VERTICAL);
134   pGridSizer->Add (new wxStaticText (this, -1, "Maximum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
135   pGridSizer->Add (m_pTextCtrlMax, 0, wxALIGN_CENTER_VERTICAL);
136   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
137
138   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
139
140   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
141   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
142   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
143   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
144   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
145
146   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
147
148   SetAutoLayout (true);
149   SetSizer (pTopSizer);
150   pTopSizer->Fit (this);
151   pTopSizer->SetSizeHints (this);
152 }
153
154 DialogGetImageMinMax::~DialogGetImageMinMax (void)
155 {
156 #if 0
157   delete m_pTextCtrlMin;
158   delete m_pTextCtrlMax;
159 #endif
160 }
161
162 double
163 DialogGetImageMinMax::getMinimum (void)
164 {
165     wxString strCtrl = m_pTextCtrlMin->GetValue();
166     double dValue;
167     if (strCtrl.ToDouble (&dValue))
168         return dValue;
169     else
170         return (m_dDefaultMin);
171 }
172
173 double
174 DialogGetImageMinMax::getMaximum (void)
175 {
176     wxString strCtrl = m_pTextCtrlMax->GetValue();
177     double dValue;
178     if (strCtrl.ToDouble (&dValue))
179         return dValue;
180     else
181         return (m_dDefaultMax);
182 }
183
184
185 /////////////////////////////////////////////////////////////////////
186 // CLASS IDENTIFICATION
187 //
188 // DialogGetRasterParameters
189 /////////////////////////////////////////////////////////////////////
190
191 DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1)
192     : wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
193 {
194   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
195
196   pTopSizer->Add (new wxStaticText (this, -1, "Set Rasterization Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
197                    
198   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
199
200   ostringstream os;
201   os << iDefaultXSize;
202   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
203   ostringstream osYSize;
204   osYSize << iDefaultYSize;
205   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
206   ostringstream osNSamples;
207   osNSamples << iDefaultNSamples;
208   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
209
210   wxGridSizer *pGridSizer = new wxGridSizer (2, 3, 5);
211   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
212   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
213   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
214   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
215   pGridSizer->Add (new wxStaticText (this, -1, "Samples per Pixel"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
216   pGridSizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
217   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
218
219   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
220
221   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
222   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
223   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
224   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
225   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
226
227   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
228
229   SetAutoLayout (true);
230   SetSizer (pTopSizer);
231   pTopSizer->Fit (this);
232   pTopSizer->SetSizeHints (this);
233 }
234
235 DialogGetRasterParameters::~DialogGetRasterParameters (void)
236 {
237 }
238
239
240 unsigned int
241 DialogGetRasterParameters::getXSize (void)
242 {
243     wxString strCtrl = m_pTextCtrlXSize->GetValue();
244     unsigned long lValue;
245     if (strCtrl.ToULong (&lValue))
246         return lValue;
247     else
248         return (m_iDefaultXSize);
249 }
250
251 unsigned int
252 DialogGetRasterParameters::getYSize (void)
253 {
254     wxString strCtrl = m_pTextCtrlYSize->GetValue();
255     unsigned long lValue;
256     if (strCtrl.ToULong (&lValue))
257         return lValue;
258     else
259         return (m_iDefaultYSize);
260 }
261
262
263 unsigned int
264 DialogGetRasterParameters::getNSamples (void)
265 {
266     wxString strCtrl = m_pTextCtrlNSamples->GetValue();
267     unsigned long lValue;
268     if (strCtrl.ToULong (&lValue))
269         return lValue;
270     else
271         return (m_iDefaultNSamples);
272 }
273
274
275
276 /////////////////////////////////////////////////////////////////////
277 // CLASS IDENTIFICATION
278 //
279 // DialogGetProjectionParameters
280 /////////////////////////////////////////////////////////////////////
281
282
283 DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet = 0, int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL)
284     : wxDialog (pParent, -1, "Set Projection Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
285 {
286   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
287
288   pTopSizer->Add (new wxStaticText (this, -1, "Set Projection Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
289                    
290   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
291
292   m_pListBoxGeometry = new StringValueAndTitleListBox (this, Scanner::getGeometryCount(), Scanner::getGeometryTitleArray(), Scanner::getGeometryNameArray());
293   m_pListBoxGeometry->SetSelection (iDefaultGeometry);
294   pTopSizer->Add (m_pListBoxGeometry, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
295
296   ostringstream os;
297   os << iDefaultNDet;
298   m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
299   ostringstream osNView;
300   osNView << iDefaultNView;
301   m_pTextCtrlNView = new wxTextCtrl (this, -1, osNView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
302   ostringstream osNSamples;
303   osNSamples << iDefaultNSamples;
304   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
305   ostringstream osRotAngle;
306   osRotAngle << dDefaultRotAngle;
307   m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
308
309   wxGridSizer *pGridSizer = new wxGridSizer (2, 4, 5);
310   pGridSizer->Add (new wxStaticText (this, -1, "Detectors"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
311   pGridSizer->Add (m_pTextCtrlNDet, 0, wxALIGN_CENTER_VERTICAL);
312   pGridSizer->Add (new wxStaticText (this, -1, "Views"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
313   pGridSizer->Add (m_pTextCtrlNView, 0, wxALIGN_CENTER_VERTICAL);
314   pGridSizer->Add (new wxStaticText (this, -1, "Samples per Detector"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
315   pGridSizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
316   pGridSizer->Add (new wxStaticText (this, -1, "Rotation Angle (PI units)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
317   pGridSizer->Add (m_pTextCtrlRotAngle, 0, wxALIGN_CENTER_VERTICAL);
318   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
319
320   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
321
322   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
323   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
324   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
325   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
326   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
327
328   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
329
330   SetAutoLayout (true);
331   SetSizer (pTopSizer);
332   pTopSizer->Fit (this);
333   pTopSizer->SetSizeHints (this);
334 }
335
336 DialogGetProjectionParameters::~DialogGetProjectionParameters (void)
337 {
338 }
339
340
341 unsigned int
342 DialogGetProjectionParameters::getNDet (void)
343 {
344     wxString strCtrl = m_pTextCtrlNDet->GetValue();
345     unsigned long lValue;
346     if (strCtrl.ToULong (&lValue))
347         return lValue;
348     else
349         return (m_iDefaultNDet);
350 }
351
352 unsigned int
353 DialogGetProjectionParameters::getNView (void)
354 {
355     wxString strCtrl = m_pTextCtrlNView->GetValue();
356     unsigned long lValue;
357     if (strCtrl.ToULong (&lValue))
358         return lValue;
359     else
360         return (m_iDefaultNView);
361 }
362
363
364 unsigned int
365 DialogGetProjectionParameters::getNSamples (void)
366 {
367     wxString strCtrl = m_pTextCtrlNSamples->GetValue();
368     unsigned long lValue;
369     if (strCtrl.ToULong (&lValue))
370         return lValue;
371     else
372         return (m_iDefaultNSamples);
373 }
374
375 double
376 DialogGetProjectionParameters::getRotAngle (void)
377 {
378     wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
379     double dValue;
380     if (strCtrl.ToDouble (&dValue))
381         return (dValue * PI);
382     else
383       return (m_dDefaultRotAngle);
384 }
385
386 const char*
387 DialogGetProjectionParameters::getGeometry (void)
388 {
389   return m_pListBoxGeometry->getSelectionStringValue();
390 }
391
392
393
394 /////////////////////////////////////////////////////////////////////
395 // CLASS IDENTIFICATION
396 //
397 // DialogGetReconstructionParameters
398 /////////////////////////////////////////////////////////////////////
399
400
401 DialogGetReconstructionParameters::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 iDefaultFilterGenerationID = ProcessSignal::FILTER_GENERATION_INVALID, int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR, int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF3)
402     : wxDialog (pParent, -1, "Set Reconstruction Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
403 {
404   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
405
406   pTopSizer->Add (new wxStaticText (this, -1, "Set Reconstruction Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
407                    
408   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
409
410   m_pListBoxFilter = new StringValueAndTitleListBox (this, SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
411   m_pListBoxFilter->SetSelection (iDefaultFilterID);
412   pTopSizer->Add (m_pListBoxFilter, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
413
414   m_pListBoxFilterMethod = new StringValueAndTitleListBox (this, ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray());
415   m_pListBoxFilterMethod->SetSelection (iDefaultFilterMethodID);
416   pTopSizer->Add (m_pListBoxFilterMethod, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
417   m_pListBoxFilterGeneration = new StringValueAndTitleListBox (this, ProcessSignal::getFilterGenerationCount(), ProcessSignal::getFilterGenerationTitleArray(), ProcessSignal::getFilterGenerationNameArray());
418   m_pListBoxFilterGeneration->SetSelection (iDefaultFilterGenerationID);
419   pTopSizer->Add (m_pListBoxFilterGeneration, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
420
421   m_pListBoxBackproject = new StringValueAndTitleListBox (this, Backprojector::getBackprojectCount(), Backprojector::getBackprojectTitleArray(), Backprojector::getBackprojectNameArray());
422   m_pListBoxBackproject->SetSelection (iDefaultBackprojectID);
423   pTopSizer->Add (m_pListBoxBackproject, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
424
425   m_pListBoxInterp = new StringValueAndTitleListBox (this, Backprojector::getInterpCount(), Backprojector::getInterpTitleArray(), Backprojector::getInterpNameArray());
426   m_pListBoxInterp->SetSelection (iDefaultInterpID);
427   pTopSizer->Add (m_pListBoxInterp, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
428
429   ostringstream os;
430   os << iDefaultXSize;
431   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
432   ostringstream osYSize;
433   osYSize << iDefaultYSize;
434   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
435   ostringstream osFilterParam;
436   osFilterParam << dDefaultFilterParam;
437   m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
438   ostringstream osZeropad;
439   osZeropad << iDefaultZeropad;
440   m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
441   ostringstream osInterpParam;
442   osInterpParam << iDefaultInterpParam;
443   m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
444
445   wxGridSizer *pGridSizer = new wxGridSizer (2, 5, 5);
446   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
447   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
448   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
449   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
450   pGridSizer->Add (new wxStaticText (this, -1, "Filter Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
451   pGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_CENTER_VERTICAL);
452   pGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
453   pGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_CENTER_VERTICAL);
454   pGridSizer->Add (new wxStaticText (this, -1, "Interpolation Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
455   pGridSizer->Add (m_pTextCtrlInterpParam, 0, wxALIGN_CENTER_VERTICAL);
456   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
457
458   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
459
460   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
461   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
462   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
463   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
464   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
465
466   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
467
468   SetAutoLayout (true);
469   SetSizer (pTopSizer);
470   pTopSizer->Fit (this);
471   pTopSizer->SetSizeHints (this);
472 }
473
474 DialogGetReconstructionParameters::~DialogGetReconstructionParameters (void)
475 {
476 }
477
478
479 unsigned int
480 DialogGetReconstructionParameters::getXSize (void)
481 {
482     wxString strCtrl = m_pTextCtrlXSize->GetValue();
483     unsigned long lValue;
484     if (strCtrl.ToULong (&lValue))
485         return lValue;
486     else
487         return (m_iDefaultXSize);
488 }
489
490 unsigned int
491 DialogGetReconstructionParameters::getYSize (void)
492 {
493     wxString strCtrl = m_pTextCtrlYSize->GetValue();
494     unsigned long lValue;
495     if (strCtrl.ToULong (&lValue))
496         return lValue;
497     else
498         return (m_iDefaultYSize);
499 }
500
501 unsigned int
502 DialogGetReconstructionParameters::getZeropad (void)
503 {
504     wxString strCtrl = m_pTextCtrlZeropad->GetValue();
505     unsigned long lValue;
506     if (strCtrl.ToULong (&lValue))
507         return lValue;
508     else
509         return (m_iDefaultZeropad);
510 }
511
512
513 unsigned int
514 DialogGetReconstructionParameters::getInterpParam (void)
515 {
516     wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
517     unsigned long lValue;
518     if (strCtrl.ToULong (&lValue))
519         return lValue;
520     else
521         return (m_iDefaultInterpParam);
522 }
523
524 double
525 DialogGetReconstructionParameters::getFilterParam (void)
526 {
527     wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
528     double dValue;
529     if (strCtrl.ToDouble (&dValue))
530         return (dValue);
531     else
532       return (m_dDefaultFilterParam);
533 }
534
535 const char*
536 DialogGetReconstructionParameters::getFilterName (void)
537 {
538   return m_pListBoxFilter->getSelectionStringValue();
539 }
540
541 const char*
542 DialogGetReconstructionParameters::getFilterMethodName (void)
543 {
544   return m_pListBoxFilterMethod->getSelectionStringValue();
545 }
546
547 const char*
548 DialogGetReconstructionParameters::getInterpName (void)
549 {
550   return m_pListBoxInterp->getSelectionStringValue();
551 }
552
553 const char*
554 DialogGetReconstructionParameters::getBackprojectName (void)
555 {
556   return m_pListBoxBackproject->getSelectionStringValue();
557 }
558
559 const char*
560 DialogGetReconstructionParameters::getFilterGenerationName (void)
561 {
562   return m_pListBoxFilterGeneration->getSelectionStringValue();
563 }