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