r326: FFTW additions, filter image generation
[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.22 2001/01/01 10:14:34 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 "ctsim.h"
51 #include "ct.h"\r
52 //#include "ctsupport.h"\r
53 //#include "scanner.h"
54 //#include "phantom.h"
55 //#include "filter.h"
56 //#include "backprojectors.h"
57 #include "docs.h"\r
58 #include "views.h"\r
59 #include "imagefile.h"\r
60
61 #if defined(MSVC) || HAVE_SSTREAM\r
62 #include <sstream>\r
63 #else\r
64 #include <sstream_subst>\r
65 #endif\r
66 \r
67
68 ///////////////////////////////////////////////////////////////////////\r
69 // CLASS IMPLEMENTATION\r
70 //    StringValueAndTitleListBox\r
71 ///////////////////////////////////////////////////////////////////////\r
72 \r
73 StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[])
74 : wxListBox ()
75 {
76   wxString* psTitle = new wxString [nChoices];
77   for (int i = 0; i < nChoices; i++)
78     psTitle[i] = aszTitle[i];
79   
80   Create (pParent, -1, wxDefaultPosition, wxSize(200,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
81   
82   m_ppszValues = aszValue;\r
83   delete [] psTitle;
84 };
85
86 const char*
87 StringValueAndTitleListBox::getSelectionStringValue (void) const
88 {
89   return m_ppszValues[GetSelection()];
90 }
91
92
93 ///////////////////////////////////////////////////////////////////////\r
94 // CLASS IMPLEMENTATION\r
95 //    DialogGetPhantom\r
96 ///////////////////////////////////////////////////////////////////////\r
97
98 DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom)
99 : wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
100 {
101   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
102   
103   pTopSizer->Add (new wxStaticText (this, -1, "Select Phantom"), 0, wxALIGN_CENTER | wxALL, 5);
104   
105   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
106   
107   m_pListBoxPhantom = new StringValueAndTitleListBox (this, Phantom::getPhantomCount(), Phantom::getPhantomTitleArray(), Phantom::getPhantomNameArray());
108   m_pListBoxPhantom->SetSelection (iDefaultPhantom);
109   pTopSizer->Add (m_pListBoxPhantom, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
110   
111   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
112   
113   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
114   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
115   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
116   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
117   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
118   
119   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
120   
121   SetAutoLayout (true);
122   SetSizer (pTopSizer);
123   pTopSizer->Fit (this);
124   pTopSizer->SetSizeHints (this);
125 }
126
127 const char*
128 DialogGetPhantom::getPhantom(void)
129 {
130   return m_pListBoxPhantom->getSelectionStringValue();
131 }
132
133 \r
134 ///////////////////////////////////////////////////////////////////////\r
135 // CLASS IMPLEMENTATION\r
136 //    DialogGetComparisonImage\r
137 ///////////////////////////////////////////////////////////////////////\r
138 \r
139 DialogGetComparisonImage::DialogGetComparisonImage (wxFrame* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)\r
140 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rVecIF(rVecIF)\r
141 {\r
142   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);\r
143   \r
144   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxALL, 5);\r
145   \r
146   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);\r
147   \r
148   int iNImages = m_rVecIF.size();\r
149   wxString* pstrImages = new wxString [iNImages];\r
150   for (int i = 0; i < iNImages; i++) {\r
151     ImageFileView* pView = dynamic_cast<ImageFileView*>(m_rVecIF[i]->GetFirstView());\r
152     if (pView)\r
153       pstrImages[i] = pView->getFrame()->GetTitle();\r
154   }\r
155 \r
156   m_pListBoxImageChoices = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, iNImages, pstrImages, wxLB_SINGLE);\r
157   delete [] pstrImages;\r
158 \r
159   m_pListBoxImageChoices->SetSelection (0);\r
160   pTopSizer->Add (m_pListBoxImageChoices, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
161   \r
162   if (bShowMakeDifference) {\r
163     m_pMakeDifferenceImage = new wxCheckBox (this, -1, "Make Difference Image");\r
164     m_pMakeDifferenceImage->SetValue (FALSE);\r
165     pTopSizer->Add (m_pMakeDifferenceImage, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
166   } else\r
167     m_pMakeDifferenceImage = NULL;\r
168 \r
169   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
170   \r
171   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);\r
172   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");\r
173   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");\r
174   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);\r
175   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);\r
176   \r
177   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);\r
178   \r
179   SetAutoLayout (true);\r
180   SetSizer (pTopSizer);\r
181   pTopSizer->Fit (this);\r
182   pTopSizer->SetSizeHints (this);\r
183 }\r
184 \r
185 ImageFileDocument*\r
186 DialogGetComparisonImage::getImageFileDocument(void)\r
187 {\r
188   return m_rVecIF[ m_pListBoxImageChoices->GetSelection() ];\r
189 }\r
190 \r
191 bool\r
192 DialogGetComparisonImage::getMakeDifferenceImage()\r
193 {\r
194   if (m_pMakeDifferenceImage)\r
195     return m_pMakeDifferenceImage->GetValue();\r
196   else\r
197     return false;\r
198 }\r
199 \r
200 \r
201 /////////////////////////////////////////////////////////////////////\r
202 // CLASS DiaglogGetMinMax Implementation\r
203 /////////////////////////////////////////////////////////////////////\r
204
205 DialogGetMinMax::DialogGetMinMax (wxFrame* pParent, const char* const pszTitle, double dDefaultMin, double dDefaultMax)
206 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
207 {
208   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
209   
210   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
211   
212   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
213   
214   std::ostringstream os;
215   os << dDefaultMin;
216   m_pTextCtrlMin = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
217   std::ostringstream osMax;
218   osMax << dDefaultMax;
219   m_pTextCtrlMax = new wxTextCtrl (this, -1, osMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
220   
221   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
222   pGridSizer->Add (new wxStaticText (this, -1, "Minimum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
223   pGridSizer->Add (m_pTextCtrlMin, 0, wxALIGN_CENTER_VERTICAL);
224   pGridSizer->Add (new wxStaticText (this, -1, "Maximum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
225   pGridSizer->Add (m_pTextCtrlMax, 0, wxALIGN_CENTER_VERTICAL);
226   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
227   
228   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
229   
230   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
231   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
232   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
233   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
234   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
235   
236   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
237   
238   SetAutoLayout (true);
239   SetSizer (pTopSizer);
240   pTopSizer->Fit (this);
241   pTopSizer->SetSizeHints (this);
242 }
243
244 DialogGetMinMax::~DialogGetMinMax (void)
245 {
246 }
247
248 double
249 DialogGetMinMax::getMinimum (void)
250 {
251   wxString strCtrl = m_pTextCtrlMin->GetValue();
252   double dValue;
253   if (strCtrl.ToDouble (&dValue))
254     return dValue;
255   else
256     return (m_dDefaultMin);
257 }
258
259 double
260 DialogGetMinMax::getMaximum (void)
261 {
262   wxString strCtrl = m_pTextCtrlMax->GetValue();
263   double dValue;
264   if (strCtrl.ToDouble (&dValue))
265     return dValue;
266   else
267     return (m_dDefaultMax);
268 }
269
270
271 /////////////////////////////////////////////////////////////////////\r
272 // CLASS DialogAutoScaleParameters IMPLEMENTATION\r
273 /////////////////////////////////////////////////////////////////////\r
274 \r
275 DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor)\r
276 : wxDialog (pParent, -1, "Auto Scale Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_dMean(mean), m_dMode(mode), m_dMedian(median), m_dStdDev(stddev)\r
277 {\r
278   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);\r
279   \r
280   pTopSizer->Add (new wxStaticText (this, -1, "Auto Scale Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);\r
281   \r
282   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
283   \r
284   wxString asTitle[3];\r
285   asTitle[0] = "Median";\r
286   asTitle[1] = "Mode";\r
287   asTitle[2] = "Mean";\r
288   \r
289   m_pListBoxCenter = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, 3, asTitle, wxLB_SINGLE | wxLB_NEEDED_SB);\r
290   m_pListBoxCenter->SetSelection (0);\r
291   pTopSizer->Add (m_pListBoxCenter, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
292   \r
293   wxGridSizer *pGridSizer = new wxGridSizer (2);\r
294   pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
295   std::ostringstream osDefaultFactor;\r
296   osDefaultFactor << dDefaultScaleFactor;\r
297   m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, osDefaultFactor.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);\r
298   pGridSizer->Add (m_pTextCtrlStdDevFactor, 0, wxALIGN_CENTER_VERTICAL);\r
299   pTopSizer->Add (pGridSizer, 1, wxALL, 10);\r
300   \r
301   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
302   \r
303   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);\r
304   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");\r
305   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");\r
306   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);\r
307   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);\r
308   \r
309   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);\r
310   \r
311   SetAutoLayout (true);\r
312   SetSizer (pTopSizer);\r
313   pTopSizer->Fit (this);\r
314   pTopSizer->SetSizeHints (this);\r
315 }\r
316 \r
317 bool\r
318 DialogAutoScaleParameters::getMinMax (double* pMin, double* pMax)\r
319 {\r
320   int iCenter = m_pListBoxCenter->GetSelection();\r
321   double dCenter = m_dMedian;\r
322   if (iCenter == 1)\r
323     dCenter = m_dMode;\r
324   else if (iCenter == 2)\r
325     dCenter = m_dMode;\r
326   \r
327   wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();\r
328   double dValue;\r
329   if (! sStddevFactor.ToDouble (&dValue)) {\r
330     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";\r
331     return false;\r
332   }\r
333   double dHalfWidth = dValue * m_dStdDev / 2;\r
334   *pMin = dCenter - dHalfWidth;\r
335   *pMax = dCenter + dHalfWidth;\r
336   *theApp->getLog() << "Setting minimum to " << *pMin << " and maximum to " << *pMax << "\n";\r
337   \r
338   return true;\r
339 }\r
340 \r
341 double\r
342 DialogAutoScaleParameters::getAutoScaleFactor ()\r
343 {\r
344   wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();\r
345   double dValue = 1.;\r
346   if (! sStddevFactor.ToDouble (&dValue)) {\r
347     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";\r
348   }\r
349   \r
350   return dValue;\r
351 }\r
352 \r
353 \r
354 /////////////////////////////////////////////////////////////////////
355 // CLASS IDENTIFICATION
356 //
357 // DialogGetRasterParameters
358 /////////////////////////////////////////////////////////////////////
359
360 DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples)
361 : wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
362 {
363   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
364   
365   pTopSizer->Add (new wxStaticText (this, -1, "Set Rasterization Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
366   
367   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
368   
369   std::ostringstream os;
370   os << iDefaultXSize;
371   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
372   std::ostringstream osYSize;
373   osYSize << iDefaultYSize;
374   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
375   std::ostringstream osNSamples;
376   osNSamples << iDefaultNSamples;
377   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
378   
379   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
380   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
381   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
382   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
383   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
384   pGridSizer->Add (new wxStaticText (this, -1, "Samples per Pixel"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
385   pGridSizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
386   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
387   
388   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
389   
390   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
391   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
392   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
393   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
394   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
395   
396   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
397   
398   SetAutoLayout (true);
399   SetSizer (pTopSizer);
400   pTopSizer->Fit (this);
401   pTopSizer->SetSizeHints (this);
402 }
403
404 DialogGetRasterParameters::~DialogGetRasterParameters (void)
405 {
406 }
407
408
409 unsigned int
410 DialogGetRasterParameters::getXSize (void)
411 {
412   wxString strCtrl = m_pTextCtrlXSize->GetValue();
413   unsigned long lValue;
414   if (strCtrl.ToULong (&lValue))
415     return lValue;
416   else
417     return (m_iDefaultXSize);
418 }
419
420 unsigned int
421 DialogGetRasterParameters::getYSize (void)
422 {
423   wxString strCtrl = m_pTextCtrlYSize->GetValue();
424   unsigned long lValue;
425   if (strCtrl.ToULong (&lValue))
426     return lValue;
427   else
428     return (m_iDefaultYSize);
429 }
430
431
432 unsigned int
433 DialogGetRasterParameters::getNSamples (void)
434 {
435   wxString strCtrl = m_pTextCtrlNSamples->GetValue();
436   unsigned long lValue;
437   if (strCtrl.ToULong (&lValue))
438     return lValue;
439   else
440     return (m_iDefaultNSamples);
441 }
442
443
444
445 /////////////////////////////////////////////////////////////////////
446 // CLASS IDENTIFICATION
447 //
448 // DialogGetProjectionParameters
449 /////////////////////////////////////////////////////////////////////
450
451
452 DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet, int iDefaultNView, int iDefaultNSamples, double dDefaultRotAngle, double dDefaultFocalLength, double dDefaultFieldOfView, int iDefaultGeometry, int iDefaultTrace)
453 : wxDialog (pParent, -1, "Set Projection Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
454 {
455   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
456   
457   m_dDefaultRotAngle = dDefaultRotAngle;
458   m_dDefaultFocalLength = dDefaultFocalLength;
459   m_dDefaultFieldOfView = dDefaultFieldOfView;
460   m_iDefaultNSamples = iDefaultNSamples;
461   m_iDefaultNView = iDefaultNView;
462   m_iDefaultNDet = iDefaultNDet;
463   m_iDefaultTrace = iDefaultTrace;
464   m_iDefaultGeometry = iDefaultGeometry;
465   
466   pTopSizer->Add (new wxStaticText (this, -1, "Set Projection Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
467   
468   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
469   
470   std::ostringstream os;
471   os << iDefaultNDet;
472   m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
473   std::ostringstream osNView;
474   osNView << iDefaultNView;
475   m_pTextCtrlNView = new wxTextCtrl (this, -1, osNView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
476   std::ostringstream osNSamples;
477   osNSamples << iDefaultNSamples;
478   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
479   std::ostringstream osRotAngle;
480   osRotAngle << dDefaultRotAngle;
481   m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
482   std::ostringstream osFocalLength;
483   osFocalLength << dDefaultFocalLength;
484   m_pTextCtrlFocalLength = new wxTextCtrl (this, -1, osFocalLength.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
485   std::ostringstream osFieldOfView;
486   osFieldOfView << dDefaultFieldOfView;
487   m_pTextCtrlFieldOfView = new wxTextCtrl (this, -1, osFieldOfView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
488   
489   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
490   pGridSizer->Add (new wxStaticText (this, -1, "Scanner Geometry"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
491   m_pListBoxGeometry = new StringValueAndTitleListBox (this, Scanner::getGeometryCount(), Scanner::getGeometryTitleArray(), Scanner::getGeometryNameArray());
492   m_pListBoxGeometry->SetSelection (iDefaultGeometry);
493   
494   pGridSizer->Add (m_pListBoxGeometry, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
495   
496   pGridSizer->Add (new wxStaticText (this, -1, "Detectors"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
497   pGridSizer->Add (m_pTextCtrlNDet, 0, wxALIGN_CENTER_VERTICAL);
498   pGridSizer->Add (new wxStaticText (this, -1, "Views"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
499   pGridSizer->Add (m_pTextCtrlNView, 0, wxALIGN_CENTER_VERTICAL);
500   pGridSizer->Add (new wxStaticText (this, -1, "Samples per Detector"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
501   pGridSizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
502   pGridSizer->Add (new wxStaticText (this, -1, "Rotation Angle (PI units)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
503   pGridSizer->Add (m_pTextCtrlRotAngle, 0, wxALIGN_CENTER_VERTICAL);
504   pGridSizer->Add (new wxStaticText (this, -1, "Focal Length Ratio (phantom radius units)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
505   pGridSizer->Add (m_pTextCtrlFocalLength, 0, wxALIGN_CENTER_VERTICAL);
506   pGridSizer->Add (new wxStaticText (this, -1, "Field of View (phantom diameter units)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
507   pGridSizer->Add (m_pTextCtrlFieldOfView, 0, wxALIGN_CENTER_VERTICAL);
508   
509   m_pListBoxTrace = new StringValueAndTitleListBox (this, Trace::getTraceCount(), Trace::getTraceTitleArray(), Trace::getTraceNameArray());
510   m_pListBoxTrace->SetSelection (iDefaultTrace);
511   
512   pGridSizer->Add (new wxStaticText (this, -1, "Trace Level"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
513   pGridSizer->Add (m_pListBoxTrace, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
514   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
515   
516   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
517   
518   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
519   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
520   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
521   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
522   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
523   
524   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
525   
526   SetAutoLayout (true);
527   SetSizer (pTopSizer);
528   pTopSizer->Fit (this);
529   pTopSizer->SetSizeHints (this);
530 }
531
532 DialogGetProjectionParameters::~DialogGetProjectionParameters (void)
533 {
534 }
535
536
537 unsigned int
538 DialogGetProjectionParameters::getNDet (void)
539 {
540   wxString strCtrl = m_pTextCtrlNDet->GetValue();
541   unsigned long lValue;
542   if (strCtrl.ToULong (&lValue))
543     return lValue;
544   else
545     return (m_iDefaultNDet);
546 }
547
548 unsigned int
549 DialogGetProjectionParameters::getNView (void)
550 {
551   wxString strCtrl = m_pTextCtrlNView->GetValue();
552   unsigned long lValue;
553   if (strCtrl.ToULong (&lValue))
554     return lValue;
555   else
556     return (m_iDefaultNView);
557 }
558
559
560 unsigned int
561 DialogGetProjectionParameters::getNSamples (void)
562 {
563   wxString strCtrl = m_pTextCtrlNSamples->GetValue();
564   unsigned long lValue;
565   if (strCtrl.ToULong (&lValue))
566     return lValue;
567   else
568     return (m_iDefaultNSamples);
569 }
570
571 double
572 DialogGetProjectionParameters::getRotAngle (void)
573 {
574   wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
575   double dValue;
576   if (strCtrl.ToDouble (&dValue))
577     return (dValue * PI);
578   else
579     return (m_dDefaultRotAngle);
580 }
581
582 double
583 DialogGetProjectionParameters::getFocalLengthRatio (void)
584 {
585   wxString strCtrl = m_pTextCtrlFocalLength->GetValue();
586   double dValue;
587   if (strCtrl.ToDouble (&dValue))
588     return (dValue);
589   else
590     return (m_dDefaultFocalLength);
591 }
592
593 double
594 DialogGetProjectionParameters::getFieldOfViewRatio (void)
595 {
596   wxString strCtrl = m_pTextCtrlFieldOfView->GetValue();
597   double dValue;
598   if (strCtrl.ToDouble (&dValue))
599     return (dValue);
600   else
601     return (m_dDefaultFieldOfView);
602 }
603
604 const char*
605 DialogGetProjectionParameters::getGeometry (void)
606 {
607   return m_pListBoxGeometry->getSelectionStringValue();
608 }
609
610 int
611 DialogGetProjectionParameters::getTrace (void)
612 {
613   return Trace::convertTraceNameToID(m_pListBoxTrace->getSelectionStringValue());
614 }
615
616
617
618 /////////////////////////////////////////////////////////////////////
619 // CLASS IDENTIFICATION
620 //
621 // DialogGetReconstructionParameters
622 /////////////////////////////////////////////////////////////////////
623
624
625 DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam,  int iDefaultFilterMethodID, int iDefaultFilterGenerationID, int iDefaultZeropad, int iDefaultInterpID, int iDefaultInterpParam, int iDefaultBackprojectID, int iTrace)
626 : wxDialog (pParent, -1, "Set Reconstruction Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
627 {
628   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
629   
630   pTopSizer->Add (new wxStaticText (this, -1, "Set Reconstruction Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
631   
632   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
633   
634   std::ostringstream os;
635   os << iDefaultXSize;
636   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
637   std::ostringstream osYSize;
638   osYSize << iDefaultYSize;
639   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
640   std::ostringstream osFilterParam;
641   osFilterParam << dDefaultFilterParam;
642   m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
643   std::ostringstream osZeropad;
644   osZeropad << iDefaultZeropad;
645   m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
646   std::ostringstream osInterpParam;
647   osInterpParam << iDefaultInterpParam;
648   m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
649   
650   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (6);
651   pGridSizer->Add (new wxStaticText (this, -1, "Filter"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
652   m_pListBoxFilter = new StringValueAndTitleListBox (this, SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
653   m_pListBoxFilter->SetSelection (iDefaultFilterID);
654   pGridSizer->Add (m_pListBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
655   
656   m_pListBoxFilterMethod = new StringValueAndTitleListBox (this, ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray());
657   m_pListBoxFilterMethod->SetSelection (iDefaultFilterMethodID);
658   pGridSizer->Add (new wxStaticText (this, -1, "Filter Method"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
659   pGridSizer->Add (m_pListBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
660   
661   m_pListBoxFilterGeneration = new StringValueAndTitleListBox (this, ProcessSignal::getFilterGenerationCount(), ProcessSignal::getFilterGenerationTitleArray(), ProcessSignal::getFilterGenerationNameArray());
662   m_pListBoxFilterGeneration->SetSelection (iDefaultFilterGenerationID);
663   pGridSizer->Add (new wxStaticText (this, -1, "Filter Generation"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
664   pGridSizer->Add (m_pListBoxFilterGeneration, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
665   \r
666   
667   m_pListBoxBackproject = new StringValueAndTitleListBox (this, Backprojector::getBackprojectCount(), Backprojector::getBackprojectTitleArray(), Backprojector::getBackprojectNameArray());
668   m_pListBoxBackproject->SetSelection (iDefaultBackprojectID);
669   pGridSizer->Add (new wxStaticText (this, -1, "Backprojection"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
670   pGridSizer->Add (m_pListBoxBackproject, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
671   
672   m_pListBoxInterp = new StringValueAndTitleListBox (this, Backprojector::getInterpCount(), Backprojector::getInterpTitleArray(), Backprojector::getInterpNameArray());
673   m_pListBoxInterp->SetSelection (iDefaultInterpID);
674   pGridSizer->Add (new wxStaticText (this, -1, "Interpolation"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
675   pGridSizer->Add (m_pListBoxInterp, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
676   
677   
678   pGridSizer->Add (new wxStaticText (this, -1, "Trace Level"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
679   static const char* aszTraceTitle[] = {"None", "Full"};\r
680   static const char* aszTraceName[] = {"none", "full"};\r
681   m_pListBoxTrace = new StringValueAndTitleListBox (this, 2, aszTraceTitle, aszTraceName);\r
682   iTrace = clamp(iTrace, 0, 1);\r
683   m_pListBoxTrace->SetSelection (iTrace);\r
684   pGridSizer->Add (m_pListBoxTrace);\r
685   \r
686   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
687   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
688   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
689   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
690   pGridSizer->Add (new wxStaticText (this, -1, "Filter Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
691   pGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
692   pGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
693   pGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
694   pGridSizer->Add (new wxStaticText (this, -1, "Interpolation Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
695   pGridSizer->Add (m_pTextCtrlInterpParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
696   
697   pTopSizer->Add (pGridSizer, 1, wxALL, 3);
698   
699   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
700   
701   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
702   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
703   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
704   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
705   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
706   
707   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
708   
709   SetAutoLayout (true);
710   SetSizer (pTopSizer);
711   pTopSizer->Layout();
712   pTopSizer->Fit (this);
713   pTopSizer->SetSizeHints (this);
714 }
715
716 DialogGetReconstructionParameters::~DialogGetReconstructionParameters (void)
717 {
718 }
719
720
721 unsigned int
722 DialogGetReconstructionParameters::getXSize (void)
723 {
724   wxString strCtrl = m_pTextCtrlXSize->GetValue();
725   unsigned long lValue;
726   if (strCtrl.ToULong (&lValue))
727     return lValue;
728   else
729     return (m_iDefaultXSize);
730 }
731
732 unsigned int
733 DialogGetReconstructionParameters::getYSize (void)
734 {
735   wxString strCtrl = m_pTextCtrlYSize->GetValue();
736   unsigned long lValue;
737   if (strCtrl.ToULong (&lValue))
738     return lValue;
739   else
740     return (m_iDefaultYSize);
741 }
742
743 unsigned int
744 DialogGetReconstructionParameters::getZeropad (void)
745 {
746   wxString strCtrl = m_pTextCtrlZeropad->GetValue();
747   unsigned long lValue;
748   if (strCtrl.ToULong (&lValue))
749     return lValue;
750   else
751     return (m_iDefaultZeropad);
752 }
753
754
755 unsigned int
756 DialogGetReconstructionParameters::getInterpParam (void)
757 {
758   wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
759   unsigned long lValue;
760   if (strCtrl.ToULong (&lValue))
761     return lValue;
762   else
763     return (m_iDefaultInterpParam);
764 }
765
766 double
767 DialogGetReconstructionParameters::getFilterParam (void)
768 {
769   wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
770   double dValue;
771   if (strCtrl.ToDouble (&dValue))
772     return (dValue);
773   else
774     return (m_dDefaultFilterParam);
775 }
776
777 const char*
778 DialogGetReconstructionParameters::getFilterName (void)
779 {
780   return m_pListBoxFilter->getSelectionStringValue();
781 }
782
783 const char*
784 DialogGetReconstructionParameters::getFilterMethodName (void)
785 {
786   return m_pListBoxFilterMethod->getSelectionStringValue();
787 }
788
789 const char*
790 DialogGetReconstructionParameters::getInterpName (void)
791 {
792   return m_pListBoxInterp->getSelectionStringValue();
793 }
794
795 int
796 DialogGetReconstructionParameters::getTrace (void)
797 {
798   int iTrace = 0;
799   if (strcmp("full", m_pListBoxTrace->getSelectionStringValue()) == 0)
800     iTrace = Trace::TRACE_PLOT;
801   return iTrace;
802 }
803
804 const char*
805 DialogGetReconstructionParameters::getBackprojectName (void)
806 {
807   return m_pListBoxBackproject->getSelectionStringValue();
808 }
809
810 const char*
811 DialogGetReconstructionParameters::getFilterGenerationName (void)
812 {
813   return m_pListBoxFilterGeneration->getSelectionStringValue();
814 }
815
816 \r
817 /////////////////////////////////////////////////////////////////////\r
818 // CLASS IDENTIFICATION\r
819 //\r
820 // DialogGetFilterParameters\r
821 /////////////////////////////////////////////////////////////////////\r
822 \r
823 \r
824 DialogGetFilterParameters::DialogGetFilterParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam,  double dDefaultBandwidth, int iDefaultDomainID)\r
825 : wxDialog (pParent, -1, "Set Filter Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)\r
826 {\r
827   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);\r
828   \r
829   pTopSizer->Add (new wxStaticText (this, -1, "Set Filter Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);\r
830   \r
831   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
832   \r
833   std::ostringstream os;\r
834   os << iDefaultXSize;\r
835   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);\r
836   std::ostringstream osYSize;\r
837   osYSize << iDefaultYSize;\r
838   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);\r
839   std::ostringstream osFilterParam;\r
840   osFilterParam << dDefaultFilterParam;\r
841   m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);\r
842   std::ostringstream osBandwidth;\r
843   osBandwidth << dDefaultBandwidth;\r
844   m_pTextCtrlBandwidth = new wxTextCtrl (this, -1, osBandwidth.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);\r
845   \r
846   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);\r
847   pGridSizer->Add (new wxStaticText (this, -1, "Filter"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);\r
848   m_pListBoxFilter = new StringValueAndTitleListBox (this, SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());\r
849   m_pListBoxFilter->SetSelection (iDefaultFilterID);\r
850   pGridSizer->Add (m_pListBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);\r
851   \r
852   m_pListBoxDomain = new StringValueAndTitleListBox (this, SignalFilter::getDomainCount(), SignalFilter::getDomainTitleArray(), SignalFilter::getDomainNameArray());\r
853   m_pListBoxDomain->SetSelection (iDefaultDomainID);\r
854   pGridSizer->Add (new wxStaticText (this, -1, "Domain"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);\r
855   pGridSizer->Add (m_pListBoxDomain, 0, wxALL | wxALIGN_LEFT | wxEXPAND);\r
856   \r
857   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
858   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);\r
859   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
860   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);\r
861   pGridSizer->Add (new wxStaticText (this, -1, "Filter Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
862   pGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);\r
863   pGridSizer->Add (new wxStaticText (this, -1, "Bandwidth"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
864   pGridSizer->Add (m_pTextCtrlBandwidth, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);\r
865   \r
866   pTopSizer->Add (pGridSizer, 1, wxALL, 3);\r
867   \r
868   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
869   \r
870   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);\r
871   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");\r
872   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");\r
873   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);\r
874   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);\r
875   \r
876   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);\r
877   \r
878   SetAutoLayout (true);\r
879   SetSizer (pTopSizer);\r
880   pTopSizer->Layout();\r
881   pTopSizer->Fit (this);\r
882   pTopSizer->SetSizeHints (this);\r
883 }\r
884 \r
885 DialogGetFilterParameters::~DialogGetFilterParameters (void)\r
886 {\r
887 }\r
888 \r
889 \r
890 unsigned int\r
891 DialogGetFilterParameters::getXSize (void)\r
892 {\r
893   wxString strCtrl = m_pTextCtrlXSize->GetValue();\r
894   unsigned long lValue;\r
895   if (strCtrl.ToULong (&lValue))\r
896     return lValue;\r
897   else\r
898     return (m_iDefaultXSize);\r
899 }\r
900 \r
901 unsigned int\r
902 DialogGetFilterParameters::getYSize (void)\r
903 {\r
904   wxString strCtrl = m_pTextCtrlYSize->GetValue();\r
905   unsigned long lValue;\r
906   if (strCtrl.ToULong (&lValue))\r
907     return lValue;\r
908   else\r
909     return (m_iDefaultYSize);\r
910 }\r
911 \r
912 double\r
913 DialogGetFilterParameters::getBandwidth (void)\r
914 {\r
915   wxString strCtrl = m_pTextCtrlBandwidth->GetValue();\r
916   double dValue;\r
917   if (strCtrl.ToDouble (&dValue))\r
918     return dValue;\r
919   else\r
920     return (m_dDefaultBandwidth);\r
921 }\r
922 \r
923 double\r
924 DialogGetFilterParameters::getFilterParam (void)\r
925 {\r
926   wxString strCtrl = m_pTextCtrlFilterParam->GetValue();\r
927   double dValue;\r
928   if (strCtrl.ToDouble (&dValue))\r
929     return (dValue);\r
930   else\r
931     return (m_dDefaultFilterParam);\r
932 }\r
933 \r
934 const char*\r
935 DialogGetFilterParameters::getFilterName (void)\r
936 {\r
937   return m_pListBoxFilter->getSelectionStringValue();\r
938 }\r
939 \r
940 const char*\r
941 DialogGetFilterParameters::getDomainName (void)\r
942 {\r
943   return m_pListBoxDomain->getSelectionStringValue();\r
944 }\r
945 \r