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