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