r545: no 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-2001 Kevin Rosenberg
11 **
12 **  $Id: dialogs.cpp,v 1.33 2001/02/16 00:28:41 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"
52 #include "docs.h"
53 #include "views.h"
54 #include "imagefile.h"
55
56 #if defined(MSVC) || HAVE_SSTREAM
57 #include <sstream>
58 #else
59 #include <sstream_subst>
60 #endif
61
62
63 ///////////////////////////////////////////////////////////////////////
64 // CLASS IMPLEMENTATION
65 //    StringValueAndTitleListBox
66 ///////////////////////////////////////////////////////////////////////
67
68 StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[])
69 : wxListBox ()
70 {
71   wxString* psTitle = new wxString [nChoices];
72   for (int i = 0; i < nChoices; i++)
73     psTitle[i] = aszTitle[i];
74   
75   Create (pParent, -1, wxDefaultPosition, wxSize(-1,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
76   
77   m_ppszValues = aszValue;
78   delete [] psTitle;
79 };
80
81 const char*
82 StringValueAndTitleListBox::getSelectionStringValue () const
83 {
84   return m_ppszValues[GetSelection()];
85 }
86
87 StringValueAndTitleRadioBox::StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* aszTitle[], const char* aszValue[])
88 : wxRadioBox ()
89 {
90   wxString* psTitle = new wxString [nChoices];
91   for (int i = 0; i < nChoices; i++)
92     psTitle[i] = aszTitle[i];
93   
94   Create (pParent, -1, strTitle, wxDefaultPosition, wxDefaultSize, nChoices, psTitle, 1, wxRA_SPECIFY_COLS);
95   
96   m_ppszValues = aszValue;
97   delete [] psTitle;
98 };
99
100 const char*
101 StringValueAndTitleRadioBox::getSelectionStringValue () const
102 {
103   return m_ppszValues[GetSelection()];
104 }
105
106 ///////////////////////////////////////////////////////////////////////
107 // CLASS IMPLEMENTATION
108 //    DialogGetPhantom
109 ///////////////////////////////////////////////////////////////////////
110
111 DialogGetPhantom::DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom)
112 : wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
113 {
114   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
115   
116   pTopSizer->Add (new wxStaticText (this, -1, "Select Phantom"), 0, wxCENTER | wxALL, 5);
117   
118   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
119   
120   m_pRadioBoxPhantom = new StringValueAndTitleRadioBox (this, _T("Phantom"), Phantom::getPhantomCount(), Phantom::getPhantomTitleArray(), Phantom::getPhantomNameArray());
121   m_pRadioBoxPhantom->SetSelection (iDefaultPhantom);
122   pTopSizer->Add (m_pRadioBoxPhantom, 0, wxALL | wxALIGN_CENTER);
123   
124   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
125   
126   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
127   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
128   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
129   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
130   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
131   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PHANTOM);
132   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
133
134   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
135   pButtonOk->SetDefault();
136   
137   SetAutoLayout (true);
138   SetSizer (pTopSizer);
139   pTopSizer->Fit (this);
140   pTopSizer->SetSizeHints (this);
141 }
142
143 const char*
144 DialogGetPhantom::getPhantom()
145 {
146   return m_pRadioBoxPhantom->getSelectionStringValue();
147 }
148
149
150 ///////////////////////////////////////////////////////////////////////
151 // CLASS IMPLEMENTATION
152 //    DialogGetComparisonImage
153 ///////////////////////////////////////////////////////////////////////
154
155 DialogGetComparisonImage::DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)
156 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rVecIF(rVecIF)
157 {
158   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
159   
160   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxALL, 5);
161   
162   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
163   
164   int iNImages = m_rVecIF.size();
165   wxString* pstrImages = new wxString [iNImages];
166   for (int i = 0; i < iNImages; i++) {
167     ImageFileView* pView = dynamic_cast<ImageFileView*>(m_rVecIF[i]->GetFirstView());
168     if (pView)
169       pstrImages[i] = pView->getFrame()->GetTitle();
170   }
171
172   m_pListBoxImageChoices = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, iNImages, pstrImages, wxLB_SINGLE);
173   delete [] pstrImages;
174
175   m_pListBoxImageChoices->SetSelection (0);
176   pTopSizer->Add (m_pListBoxImageChoices, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
177   
178   if (bShowMakeDifference) {
179     m_pMakeDifferenceImage = new wxCheckBox (this, -1, "Make Difference Image");
180     m_pMakeDifferenceImage->SetValue (FALSE);
181     pTopSizer->Add (m_pMakeDifferenceImage, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
182   } else
183     m_pMakeDifferenceImage = NULL;
184
185   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
186   
187   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
188   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
189   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
190   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
191   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
192   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_COMPARISON);
193   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
194   
195   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
196   pButtonOk->SetDefault();
197   
198   SetAutoLayout (true);
199   SetSizer (pTopSizer);
200   pTopSizer->Fit (this);
201   pTopSizer->SetSizeHints (this);
202 }
203
204 ImageFileDocument*
205 DialogGetComparisonImage::getImageFileDocument()
206 {
207   return m_rVecIF[ m_pListBoxImageChoices->GetSelection() ];
208 }
209
210 bool
211 DialogGetComparisonImage::getMakeDifferenceImage()
212 {
213   if (m_pMakeDifferenceImage)
214     return m_pMakeDifferenceImage->GetValue();
215   else
216     return false;
217 }
218
219
220 /////////////////////////////////////////////////////////////////////
221 // CLASS DiaglogPreferences Implementation
222 /////////////////////////////////////////////////////////////////////
223
224 DialogPreferences::DialogPreferences (wxWindow* pParent, const char* const pszTitle, 
225                                       bool bAdvancedOptions, bool bAskDeleteNewDocs)
226 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
227 {
228   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
229   
230   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
231   
232   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
233
234   m_pCBAdvancedOptions = new wxCheckBox (this, -1, "Advanced Options", wxDefaultPosition, wxSize(250, 25), 0);
235   m_pCBAdvancedOptions->SetValue (bAdvancedOptions);
236   pTopSizer->Add (m_pCBAdvancedOptions, 0, wxALIGN_CENTER_VERTICAL);
237
238   m_pCBAskDeleteNewDocs = new wxCheckBox (this, -1, "Ask \"Save New Documents\" Before Closing", wxDefaultPosition, wxSize(250, 25), 0);
239   m_pCBAskDeleteNewDocs->SetValue (bAskDeleteNewDocs);
240   pTopSizer->Add (m_pCBAskDeleteNewDocs, 0, wxALIGN_CENTER_VERTICAL);
241
242   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
243   
244   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
245   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
246   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
247   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
248   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
249   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PREFERENCES);
250   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
251   
252   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
253   pButtonOk->SetDefault();
254   
255   SetAutoLayout (true);
256   SetSizer (pTopSizer);
257   pTopSizer->Fit (this);
258   pTopSizer->SetSizeHints (this);
259 }
260
261 DialogPreferences::~DialogPreferences ()
262 {
263 }
264
265 bool
266 DialogPreferences::getAdvancedOptions ()
267 {
268   return static_cast<bool>(m_pCBAdvancedOptions->GetValue());
269 }
270
271 bool
272 DialogPreferences::getAskDeleteNewDocs ()
273 {
274   return static_cast<bool>(m_pCBAskDeleteNewDocs->GetValue());
275 }
276
277
278 /////////////////////////////////////////////////////////////////////
279 // CLASS DiaglogGetMinMax Implementation
280 /////////////////////////////////////////////////////////////////////
281
282 DialogGetMinMax::DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin, double dDefaultMax)
283 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
284 {
285   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
286   
287   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 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   std::ostringstream os;
292   os << dDefaultMin;
293   m_pTextCtrlMin = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
294   std::ostringstream osMax;
295   osMax << dDefaultMax;
296   m_pTextCtrlMax = new wxTextCtrl (this, -1, osMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
297   
298   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
299   pGridSizer->Add (new wxStaticText (this, -1, "Minimum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
300   pGridSizer->Add (m_pTextCtrlMin, 0, wxALIGN_CENTER_VERTICAL);
301   pGridSizer->Add (new wxStaticText (this, -1, "Maximum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
302   pGridSizer->Add (m_pTextCtrlMax, 0, wxALIGN_CENTER_VERTICAL);
303   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
304   
305   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
306   
307   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
308   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
309   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
310   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
311   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
312   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_MINMAX);
313   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
314   
315   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
316   pButtonOk->SetDefault();
317   
318   SetAutoLayout (true);
319   SetSizer (pTopSizer);
320   pTopSizer->Fit (this);
321   pTopSizer->SetSizeHints (this);
322 }
323
324 DialogGetMinMax::~DialogGetMinMax ()
325 {
326 }
327
328 double
329 DialogGetMinMax::getMinimum ()
330 {
331   wxString strCtrl = m_pTextCtrlMin->GetValue();
332   double dValue;
333   if (strCtrl.ToDouble (&dValue))
334     return dValue;
335   else
336     return (m_dDefaultMin);
337 }
338
339 double
340 DialogGetMinMax::getMaximum ()
341 {
342   wxString strCtrl = m_pTextCtrlMax->GetValue();
343   double dValue;
344   if (strCtrl.ToDouble (&dValue))
345     return dValue;
346   else
347     return (m_dDefaultMax);
348 }
349
350
351 /////////////////////////////////////////////////////////////////////
352 // CLASS DialogAutoScaleParameters IMPLEMENTATION
353 /////////////////////////////////////////////////////////////////////
354
355 DialogAutoScaleParameters::DialogAutoScaleParameters (wxWindow *pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor)
356 : wxDialog (pParent, -1, "Auto Scale Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_dMean(mean), m_dMode(mode), m_dMedian(median), m_dStdDev(stddev)
357 {
358   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
359   
360   pTopSizer->Add (new wxStaticText (this, -1, "Auto Scale Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
361   
362   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
363   
364   wxString asTitle[] = {"Median", "Mode", "Mean"};
365   
366   m_pRadioBoxCenter = new wxRadioBox (this, -1, _T("Center"), wxDefaultPosition, wxDefaultSize, 3, asTitle, 1, wxRA_SPECIFY_COLS);
367   m_pRadioBoxCenter->SetSelection (0);
368   pTopSizer->Add (m_pRadioBoxCenter, 0, wxALL | wxALIGN_CENTER);
369   
370   wxGridSizer *pGridSizer = new wxGridSizer (2);
371   pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
372   std::ostringstream osDefaultFactor;
373   osDefaultFactor << dDefaultScaleFactor;
374   m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, osDefaultFactor.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
375   pGridSizer->Add (m_pTextCtrlStdDevFactor, 0, wxALIGN_CENTER_VERTICAL);
376   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
377   
378   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
379   
380   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
381   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
382   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
383   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
384   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
385   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_AUTOSCALE);
386   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
387   
388   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
389   pButtonOk->SetDefault();
390   
391   SetAutoLayout (true);
392   SetSizer (pTopSizer);
393   pTopSizer->Fit (this);
394   pTopSizer->SetSizeHints (this);
395 }
396
397 bool
398 DialogAutoScaleParameters::getMinMax (double* pMin, double* pMax)
399 {
400   int iCenter = m_pRadioBoxCenter->GetSelection();
401   double dCenter = m_dMedian;
402   if (iCenter == 1)
403     dCenter = m_dMode;
404   else if (iCenter == 2)
405     dCenter = m_dMode;
406   
407   wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
408   double dValue;
409   if (! sStddevFactor.ToDouble (&dValue)) {
410     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";
411     return false;
412   }
413   double dHalfWidth = dValue * m_dStdDev / 2;
414   *pMin = dCenter - dHalfWidth;
415   *pMax = dCenter + dHalfWidth;
416   *theApp->getLog() << "Setting minimum to " << *pMin << " and maximum to " << *pMax << "\n";
417   
418   return true;
419 }
420
421 double
422 DialogAutoScaleParameters::getAutoScaleFactor ()
423 {
424   wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
425   double dValue = 1.;
426   if (! sStddevFactor.ToDouble (&dValue)) {
427     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";
428   }
429   
430   return dValue;
431 }
432
433
434
435 /////////////////////////////////////////////////////////////////////
436 // CLASS IDENTIFICATION
437 //
438 // DialogGetRasterParameters
439 /////////////////////////////////////////////////////////////////////
440
441 DialogGetRasterParameters::DialogGetRasterParameters 
442    (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples, double dDefaultViewRatio)
443 : wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
444 {
445   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
446   
447   pTopSizer->Add (new wxStaticText (this, -1, "Set Rasterization Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
448   
449   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
450     
451   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
452   std::ostringstream os;
453   os << iDefaultXSize;
454   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
455   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
456   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
457   std::ostringstream osYSize;
458   osYSize << iDefaultYSize;
459   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
460   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
461   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
462   std::ostringstream osViewRatio;
463   osViewRatio << dDefaultViewRatio;
464   m_pTextCtrlViewRatio = new wxTextCtrl (this, -1, osViewRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
465   pGridSizer->Add (new wxStaticText (this, -1, "View Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
466   pGridSizer->Add (m_pTextCtrlViewRatio, 0, wxALIGN_CENTER_VERTICAL);
467   std::ostringstream osNSamples;
468   osNSamples << iDefaultNSamples;
469   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
470   pGridSizer->Add (new wxStaticText (this, -1, "Samples per Pixel"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
471   pGridSizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
472
473   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
474   
475   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
476   
477   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
478   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
479   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
480   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
481   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
482   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_RASTERIZE);
483   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
484
485   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
486   pButtonOk->SetDefault();
487   
488   SetAutoLayout (true);
489   SetSizer (pTopSizer);
490   pTopSizer->Fit (this);
491   pTopSizer->SetSizeHints (this);
492 }
493
494 DialogGetRasterParameters::~DialogGetRasterParameters ()
495 {
496 }
497
498
499 unsigned int
500 DialogGetRasterParameters::getXSize ()
501 {
502   wxString strCtrl = m_pTextCtrlXSize->GetValue();
503   unsigned long lValue;
504   if (strCtrl.ToULong (&lValue))
505     return lValue;
506   else
507     return (m_iDefaultXSize);
508 }
509
510 unsigned int
511 DialogGetRasterParameters::getYSize ()
512 {
513   wxString strCtrl = m_pTextCtrlYSize->GetValue();
514   unsigned long lValue;
515   if (strCtrl.ToULong (&lValue))
516     return lValue;
517   else
518     return (m_iDefaultYSize);
519 }
520
521 unsigned int
522 DialogGetRasterParameters::getNSamples ()
523 {
524   wxString strCtrl = m_pTextCtrlNSamples->GetValue();
525   unsigned long lValue;
526   if (strCtrl.ToULong (&lValue))
527     return lValue;
528   else
529     return (m_iDefaultNSamples);
530 }
531
532 double
533 DialogGetRasterParameters::getViewRatio ()
534 {
535   wxString strCtrl = m_pTextCtrlViewRatio->GetValue();
536   double dValue;
537   if (strCtrl.ToDouble (&dValue))
538     return dValue;
539   else
540     return (m_dDefaultViewRatio);
541 }
542
543
544 /////////////////////////////////////////////////////////////////////
545 // CLASS IDENTIFICATION
546 //
547 // DialogGetProjectionParameters
548 /////////////////////////////////////////////////////////////////////
549
550
551 DialogGetProjectionParameters::DialogGetProjectionParameters 
552    (wxWindow* pParent, int iDefaultNDet, int iDefaultNView, int iDefaultNSamples, 
553     double dDefaultRotAngle, double dDefaultFocalLength, double dDefaultViewRatio,
554     double dDefaultScanRatio, int iDefaultGeometry, int iDefaultTrace)
555 : wxDialog (pParent, -1, "Set Projection Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
556 {
557   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
558   
559   m_dDefaultRotAngle = dDefaultRotAngle;
560   m_dDefaultFocalLength = dDefaultFocalLength;
561   m_dDefaultViewRatio = dDefaultViewRatio;
562   m_dDefaultScanRatio = dDefaultScanRatio;
563   m_iDefaultNSamples = iDefaultNSamples;
564   m_iDefaultNView = iDefaultNView;
565   m_iDefaultNDet = iDefaultNDet;
566   m_iDefaultTrace = iDefaultTrace;
567   m_iDefaultGeometry = iDefaultGeometry;
568   
569   pTopSizer->Add (new wxStaticText (this, -1, "Set Projection Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
570   
571   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
572     
573   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
574   m_pRadioBoxGeometry = new StringValueAndTitleRadioBox (this, _T("Geometry"), Scanner::getGeometryCount(), Scanner::getGeometryTitleArray(), Scanner::getGeometryNameArray());
575   m_pRadioBoxGeometry->SetSelection (iDefaultGeometry);
576   
577   pGridSizer->Add (m_pRadioBoxGeometry, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
578   
579   m_pRadioBoxTrace = new StringValueAndTitleRadioBox (this, _T("Trace Level"), Trace::getTraceCount(), Trace::getTraceTitleArray(), Trace::getTraceNameArray());
580   m_pRadioBoxTrace->SetSelection (iDefaultTrace);
581   pGridSizer->Add (m_pRadioBoxTrace, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
582
583           wxFlexGridSizer* pText1Sizer = new wxFlexGridSizer(2);
584   std::ostringstream os;
585   os << iDefaultNDet;
586   m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
587   pText1Sizer->Add (new wxStaticText (this, -1, "Detectors"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
588   pText1Sizer->Add (m_pTextCtrlNDet, 0, wxALIGN_CENTER_VERTICAL);
589   std::ostringstream osNView;
590   osNView << iDefaultNView;
591   m_pTextCtrlNView = new wxTextCtrl (this, -1, osNView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
592   pText1Sizer->Add (new wxStaticText (this, -1, "Views"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
593   pText1Sizer->Add (m_pTextCtrlNView, 0, wxALIGN_CENTER_VERTICAL);
594   std::ostringstream osNSamples;
595   osNSamples << iDefaultNSamples;
596   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
597   pText1Sizer->Add (new wxStaticText (this, -1, "Samples per Detector"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
598   pText1Sizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
599
600   pGridSizer->Add (pText1Sizer);
601
602   wxFlexGridSizer* pText2Sizer = new wxFlexGridSizer(2);
603   std::ostringstream osViewRatio;
604   osViewRatio << dDefaultViewRatio;
605   m_pTextCtrlViewRatio = new wxTextCtrl (this, -1, osViewRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
606   pText2Sizer->Add (new wxStaticText (this, -1, "View Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
607   pText2Sizer->Add (m_pTextCtrlViewRatio, 0, wxALIGN_CENTER_VERTICAL);
608   std::ostringstream osScanRatio;
609   osScanRatio << dDefaultScanRatio;
610   m_pTextCtrlScanRatio = new wxTextCtrl (this, -1, osScanRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
611   pText2Sizer->Add (new wxStaticText (this, -1, "Scan Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
612   pText2Sizer->Add (m_pTextCtrlScanRatio, 0, wxALIGN_CENTER_VERTICAL);
613   std::ostringstream osFocalLength;
614   osFocalLength << dDefaultFocalLength;
615   m_pTextCtrlFocalLength = new wxTextCtrl (this, -1, osFocalLength.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
616   pText2Sizer->Add (new wxStaticText (this, -1, "Focal Length Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
617   pText2Sizer->Add (m_pTextCtrlFocalLength, 0, wxALIGN_CENTER_VERTICAL);
618   
619   if (theApp->getAdvancedOptions()) {
620     std::ostringstream osRotAngle;
621     osRotAngle << dDefaultRotAngle;
622     m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
623     pText2Sizer->Add (new wxStaticText (this, -1, "Rotation Angle (PI units)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
624     pText2Sizer->Add (m_pTextCtrlRotAngle, 0, wxALIGN_CENTER_VERTICAL);
625   }
626   pGridSizer->Add (pText2Sizer);
627
628   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
629   
630   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
631   
632   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
633   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
634   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
635   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
636   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
637   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PROJECTIONS);
638   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
639   
640   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
641   pButtonOk->SetDefault();
642   
643   SetAutoLayout (true);
644   SetSizer (pTopSizer);
645   pTopSizer->Fit (this);
646   pTopSizer->SetSizeHints (this);
647 }
648
649 DialogGetProjectionParameters::~DialogGetProjectionParameters ()
650 {
651 }
652
653
654 unsigned int
655 DialogGetProjectionParameters::getNDet ()
656 {
657   wxString strCtrl = m_pTextCtrlNDet->GetValue();
658   unsigned long lValue;
659   if (strCtrl.ToULong (&lValue))
660     return lValue;
661   else
662     return (m_iDefaultNDet);
663 }
664
665 unsigned int
666 DialogGetProjectionParameters::getNView ()
667 {
668   wxString strCtrl = m_pTextCtrlNView->GetValue();
669   unsigned long lValue;
670   if (strCtrl.ToULong (&lValue))
671     return lValue;
672   else
673     return (m_iDefaultNView);
674 }
675
676
677 unsigned int
678 DialogGetProjectionParameters::getNSamples ()
679 {
680   wxString strCtrl = m_pTextCtrlNSamples->GetValue();
681   unsigned long lValue;
682   if (strCtrl.ToULong (&lValue))
683     return lValue;
684   else
685     return (m_iDefaultNSamples);
686 }
687
688 double
689 DialogGetProjectionParameters::getRotAngle ()
690 {
691   if (theApp->getAdvancedOptions()) {
692     wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
693     double dValue;
694     if (strCtrl.ToDouble (&dValue))
695       return (dValue * PI);
696     else
697       return (m_dDefaultRotAngle);
698   } else {
699     if (Scanner::convertGeometryNameToID (m_pRadioBoxGeometry->getSelectionStringValue()) == 
700           Scanner::GEOMETRY_PARALLEL)
701       return (PI);
702     else
703       return (2 * PI);
704   }
705 }
706
707 double
708 DialogGetProjectionParameters::getFocalLengthRatio ()
709 {
710   wxString strCtrl = m_pTextCtrlFocalLength->GetValue();
711   double dValue;
712   if (strCtrl.ToDouble (&dValue))
713     return (dValue);
714   else
715     return (m_dDefaultFocalLength);
716 }
717
718 double
719 DialogGetProjectionParameters::getViewRatio ()
720 {
721   wxString strCtrl = m_pTextCtrlViewRatio->GetValue();
722   double dValue;
723   if (strCtrl.ToDouble (&dValue))
724     return (dValue);
725   else
726     return (m_dDefaultViewRatio);
727 }
728
729 double
730 DialogGetProjectionParameters::getScanRatio ()
731 {
732   wxString strCtrl = m_pTextCtrlScanRatio->GetValue();
733   double dValue;
734   if (strCtrl.ToDouble (&dValue))
735     return (dValue);
736   else
737     return (m_dDefaultScanRatio);
738 }
739
740 const char*
741 DialogGetProjectionParameters::getGeometry ()
742 {
743   return m_pRadioBoxGeometry->getSelectionStringValue();
744 }
745
746 int
747 DialogGetProjectionParameters::getTrace ()
748 {
749   return Trace::convertTraceNameToID(m_pRadioBoxTrace->getSelectionStringValue());
750 }
751
752
753
754 /////////////////////////////////////////////////////////////////////
755 // CLASS IDENTIFICATION
756 //
757 // DialogGetReconstructionParameters
758 /////////////////////////////////////////////////////////////////////
759
760
761 DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize, 
762                      int iDefaultYSize, int iDefaultFilterID, double dDefaultHammingParam,  
763                      int iDefaultFilterMethodID, int iDefaultFilterGenerationID, int iDefaultZeropad, 
764                      int iDefaultInterpID, int iDefaultInterpParam, int iDefaultBackprojectID, int iTrace)
765 : wxDialog (pParent, -1, "Set Reconstruction Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
766 {
767   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
768   
769   pTopSizer->Add (new wxStaticText (this, -1, "Set Reconstruction Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
770   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
771   
772   wxFlexGridSizer* pGridSizer = NULL;
773   if (theApp->getAdvancedOptions())
774     pGridSizer = new wxFlexGridSizer (4);
775   else
776     pGridSizer = new wxFlexGridSizer (3);
777
778   if (theApp->getAdvancedOptions())
779     m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
780   else
781     m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getReconstructFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
782   m_pRadioBoxFilter->SetSelection (iDefaultFilterID);
783   pGridSizer->Add (m_pRadioBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
784   
785   m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray());
786   m_pRadioBoxFilterMethod->SetSelection (iDefaultFilterMethodID);
787   pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
788   
789   if (theApp->getAdvancedOptions()) {
790     m_pRadioBoxFilterGeneration = new StringValueAndTitleRadioBox (this, _T("Filter Generation"), ProcessSignal::getFilterGenerationCount(), ProcessSignal::getFilterGenerationTitleArray(), ProcessSignal::getFilterGenerationNameArray());
791     m_pRadioBoxFilterGeneration->SetSelection (iDefaultFilterGenerationID);
792     pGridSizer->Add (m_pRadioBoxFilterGeneration, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
793   
794     m_pRadioBoxBackproject = new StringValueAndTitleRadioBox (this, _T("Backprojection"), Backprojector::getBackprojectCount(), Backprojector::getBackprojectTitleArray(), Backprojector::getBackprojectNameArray());
795     m_pRadioBoxBackproject->SetSelection (iDefaultBackprojectID);
796     pGridSizer->Add (m_pRadioBoxBackproject, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
797   }
798
799   m_pRadioBoxInterp = new StringValueAndTitleRadioBox (this, _T("Interpolation"), Backprojector::getInterpCount(), Backprojector::getInterpTitleArray(), Backprojector::getInterpNameArray());
800   m_pRadioBoxInterp->SetSelection (iDefaultInterpID);
801   pGridSizer->Add (m_pRadioBoxInterp, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
802   
803   static const char* aszTraceTitle[] = {"None", "Full"};
804   static const char* aszTraceName[] = {"none", "full"};
805   m_pRadioBoxTrace = new StringValueAndTitleRadioBox (this, _T("Trace Level"), 2, aszTraceTitle, aszTraceName);
806   iTrace = clamp(iTrace, 0, 1);
807   m_pRadioBoxTrace->SetSelection (iTrace);
808   pGridSizer->Add (m_pRadioBoxTrace);
809
810   wxFlexGridSizer* pTextGridSizer = new wxFlexGridSizer (2);
811   std::ostringstream os;
812   os << iDefaultXSize;
813   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
814   pTextGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
815   pTextGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
816   std::ostringstream osYSize;
817   osYSize << iDefaultYSize;
818   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
819   pTextGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
820   pTextGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
821
822   std::ostringstream osHammingParam;
823   osHammingParam << dDefaultHammingParam;
824   m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osHammingParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
825   pTextGridSizer->Add (new wxStaticText (this, -1, "Hamming Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
826   pTextGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
827
828   if (theApp->getAdvancedOptions()) {
829     std::ostringstream osZeropad;
830     osZeropad << iDefaultZeropad;
831     m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
832     pTextGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
833     pTextGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
834   }
835   pGridSizer->Add (pTextGridSizer);
836
837 #if HAVE_FREQ_PREINTERP
838   std::ostringstream osInterpParam;
839   osInterpParam << iDefaultInterpParam;
840   m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
841   pGridSizer->Add (new wxStaticText (this, -1, "Interpolation Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
842   pGridSizer->Add (m_pTextCtrlInterpParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
843 #endif  
844   
845   pTopSizer->Add (pGridSizer, 1, wxALL, 3);
846   
847   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
848   
849   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
850   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
851   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
852   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
853   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
854   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_RECONSTRUCTION);
855   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
856   
857   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
858   pButtonOk->SetDefault();
859   
860   SetAutoLayout (true);
861   SetSizer (pTopSizer);
862   pTopSizer->Layout();
863   pTopSizer->Fit (this);
864   pTopSizer->SetSizeHints (this);
865 }
866
867 DialogGetReconstructionParameters::~DialogGetReconstructionParameters ()
868 {
869 }
870
871
872 unsigned int
873 DialogGetReconstructionParameters::getXSize ()
874 {
875   wxString strCtrl = m_pTextCtrlXSize->GetValue();
876   unsigned long lValue;
877   if (strCtrl.ToULong (&lValue))
878     return lValue;
879   else
880     return (m_iDefaultXSize);
881 }
882
883 unsigned int
884 DialogGetReconstructionParameters::getYSize ()
885 {
886   wxString strCtrl = m_pTextCtrlYSize->GetValue();
887   unsigned long lValue;
888   if (strCtrl.ToULong (&lValue))
889     return lValue;
890   else
891     return (m_iDefaultYSize);
892 }
893
894 unsigned int
895 DialogGetReconstructionParameters::getZeropad ()
896 {
897   if (theApp->getAdvancedOptions()) {
898     wxString strCtrl = m_pTextCtrlZeropad->GetValue();
899     unsigned long lValue;
900     if (strCtrl.ToULong (&lValue))
901       return lValue;
902     else
903       return (m_iDefaultZeropad);
904   } else
905     return 1;
906 }
907
908
909 unsigned int
910 DialogGetReconstructionParameters::getInterpParam ()
911 {
912 #if HAVE_FREQ_PREINTERP
913   wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
914   unsigned long lValue;
915   if (strCtrl.ToULong (&lValue))
916     return lValue;
917   else
918     return (m_iDefaultInterpParam);
919 #else
920   return 1;
921 #endif
922 }
923
924 double
925 DialogGetReconstructionParameters::getFilterParam ()
926 {
927   wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
928   double dValue;
929   if (strCtrl.ToDouble (&dValue))
930     return (dValue);
931   else
932     return (m_dDefaultFilterParam);
933 }
934
935 const char*
936 DialogGetReconstructionParameters::getFilterName ()
937 {
938   return m_pRadioBoxFilter->getSelectionStringValue();
939 }
940
941 const char*
942 DialogGetReconstructionParameters::getFilterMethodName ()
943 {
944   return m_pRadioBoxFilterMethod->getSelectionStringValue();
945 }
946
947 const char*
948 DialogGetReconstructionParameters::getInterpName ()
949 {
950   return m_pRadioBoxInterp->getSelectionStringValue();
951 }
952
953 int
954 DialogGetReconstructionParameters::getTrace ()
955 {
956   int iTrace = 0;
957   if (strcmp("full", m_pRadioBoxTrace->getSelectionStringValue()) == 0)
958     iTrace = Trace::TRACE_PLOT;
959   return iTrace;
960 }
961
962 const char*
963 DialogGetReconstructionParameters::getBackprojectName ()
964 {
965   if (theApp->getAdvancedOptions()) {
966     return m_pRadioBoxBackproject->getSelectionStringValue();
967   } else
968     return "idiff";
969 }
970
971 const char*
972 DialogGetReconstructionParameters::getFilterGenerationName ()
973 {
974   if (theApp->getAdvancedOptions()) {
975     return m_pRadioBoxFilterGeneration->getSelectionStringValue();
976   } else {
977     if (ProcessSignal::convertFilterMethodNameToID(m_pRadioBoxFilterMethod->getSelectionStringValue())
978         == ProcessSignal::FILTER_METHOD_CONVOLUTION)
979       return "direct";
980     else
981       return "inverse-fourier";
982   }
983 }
984
985
986 /////////////////////////////////////////////////////////////////////
987 // CLASS IDENTIFICATION
988 //
989 // DialogGetFilterParameters
990 /////////////////////////////////////////////////////////////////////
991
992
993
994 DialogGetFilterParameters::DialogGetFilterParameters (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam,  double dDefaultBandwidth, int iDefaultDomainID, double dDefaultInputScale, double dDefaultOutputScale)
995 : wxDialog (pParent, -1, "Set Filter Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
996 {
997   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
998   
999   pTopSizer->Add (new wxStaticText (this, -1, "Set Filter Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5); 
1000   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1001   
1002   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
1003
1004   m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
1005   m_pRadioBoxFilter->SetSelection (iDefaultFilterID);
1006   pGridSizer->Add (m_pRadioBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
1007   
1008   m_pRadioBoxDomain = new StringValueAndTitleRadioBox (this, _T("Domain"), SignalFilter::getDomainCount(), SignalFilter::getDomainTitleArray(), SignalFilter::getDomainNameArray());
1009   m_pRadioBoxDomain->SetSelection (iDefaultDomainID);
1010   pGridSizer->Add (m_pRadioBoxDomain, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
1011   
1012   std::ostringstream os;
1013   os << iDefaultXSize;
1014   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1015   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1016   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1017
1018   std::ostringstream osYSize;
1019   osYSize << iDefaultYSize;
1020   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1021   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1022   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1023
1024   std::ostringstream osFilterParam;
1025   osFilterParam << dDefaultFilterParam;
1026   m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1027   pGridSizer->Add (new wxStaticText (this, -1, "Filter Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1028   pGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1029
1030   std::ostringstream osBandwidth;
1031   osBandwidth << dDefaultBandwidth;
1032   m_pTextCtrlBandwidth = new wxTextCtrl (this, -1, osBandwidth.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1033   pGridSizer->Add (new wxStaticText (this, -1, "Bandwidth"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1034   pGridSizer->Add (m_pTextCtrlBandwidth, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1035
1036   std::ostringstream osInputScale;
1037   osInputScale << dDefaultInputScale;
1038   m_pTextCtrlInputScale = new wxTextCtrl (this, -1, osInputScale.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1039   pGridSizer->Add (new wxStaticText (this, -1, "Axis (input) Scale"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1040   pGridSizer->Add (m_pTextCtrlInputScale, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1041
1042   std::ostringstream osOutputScale;
1043   osOutputScale << dDefaultOutputScale;
1044   m_pTextCtrlOutputScale = new wxTextCtrl (this, -1, osOutputScale.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1045   pGridSizer->Add (new wxStaticText (this, -1, "Filter Output Scale"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1046   pGridSizer->Add (m_pTextCtrlOutputScale, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1047   
1048   pTopSizer->Add (pGridSizer, 1, wxALL, 3);
1049   
1050   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1051   
1052   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1053   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1054   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1055   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1056   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1057   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_FILTER);
1058   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
1059   
1060   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1061   pButtonOk->SetDefault();
1062
1063   SetAutoLayout (true);
1064   SetSizer (pTopSizer);
1065   pTopSizer->Layout();
1066   pTopSizer->Fit (this);
1067   pTopSizer->SetSizeHints (this);
1068 }
1069
1070 DialogGetFilterParameters::~DialogGetFilterParameters ()
1071 {
1072 }
1073
1074
1075 unsigned int
1076 DialogGetFilterParameters::getXSize ()
1077 {
1078   wxString strCtrl = m_pTextCtrlXSize->GetValue();
1079   unsigned long lValue;
1080   if (strCtrl.ToULong (&lValue))
1081     return lValue;
1082   else
1083     return (m_iDefaultXSize);
1084 }
1085
1086 unsigned int
1087 DialogGetFilterParameters::getYSize ()
1088 {
1089   wxString strCtrl = m_pTextCtrlYSize->GetValue();
1090   unsigned long lValue;
1091   if (strCtrl.ToULong (&lValue))
1092     return lValue;
1093   else
1094     return (m_iDefaultYSize);
1095 }
1096
1097 double
1098 DialogGetFilterParameters::getBandwidth ()
1099 {
1100   wxString strCtrl = m_pTextCtrlBandwidth->GetValue();
1101   double dValue;
1102   if (strCtrl.ToDouble (&dValue))
1103     return dValue;
1104   else
1105     return (m_dDefaultBandwidth);
1106 }
1107
1108 double
1109 DialogGetFilterParameters::getFilterParam ()
1110 {
1111   wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
1112   double dValue;
1113   if (strCtrl.ToDouble (&dValue))
1114     return (dValue);
1115   else
1116     return (m_dDefaultFilterParam);
1117 }
1118
1119 double
1120 DialogGetFilterParameters::getInputScale ()
1121 {
1122   wxString strCtrl = m_pTextCtrlInputScale->GetValue();
1123   double dValue;
1124   if (strCtrl.ToDouble (&dValue))
1125     return dValue;
1126   else
1127     return (m_dDefaultInputScale);
1128 }
1129
1130 double
1131 DialogGetFilterParameters::getOutputScale ()
1132 {
1133   wxString strCtrl = m_pTextCtrlOutputScale->GetValue();
1134   double dValue;
1135   if (strCtrl.ToDouble (&dValue))
1136     return dValue;
1137   else
1138     return (m_dDefaultOutputScale);
1139 }
1140
1141 const char*
1142 DialogGetFilterParameters::getFilterName ()
1143 {
1144   return m_pRadioBoxFilter->getSelectionStringValue();
1145 }
1146
1147 const char*
1148 DialogGetFilterParameters::getDomainName ()
1149 {
1150   return m_pRadioBoxDomain->getSelectionStringValue();
1151 }
1152
1153
1154 ///////////////////////////////////////////////////////////////////////
1155 // CLASS IMPLEMENTATION
1156 //    DialogExportParameters
1157 ///////////////////////////////////////////////////////////////////////
1158
1159 DialogExportParameters::DialogExportParameters (wxWindow* pParent, int iDefaultFormatID)
1160 : wxDialog (pParent, -1, "Select ExportParameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
1161 {
1162   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
1163   
1164   pTopSizer->Add (new wxStaticText (this, -1, "Select Export Format"), 0, wxALIGN_CENTER | wxALL, 5);
1165   
1166   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
1167   
1168   m_pRadioBoxFormat = new StringValueAndTitleRadioBox (this, _T("Export Type"), ImageFile::getFormatCount(), ImageFile::getFormatTitleArray(), ImageFile::getFormatNameArray());
1169   m_pRadioBoxFormat->SetSelection (iDefaultFormatID);
1170   pTopSizer->Add (m_pRadioBoxFormat, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
1171   
1172   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1173   
1174   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1175   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1176   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1177   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1178   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1179   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_EXPORT);
1180   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
1181   
1182   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1183   pButtonOk->SetDefault();
1184
1185   SetAutoLayout (true);
1186   SetSizer (pTopSizer);
1187   pTopSizer->Fit (this);
1188   pTopSizer->SetSizeHints (this);
1189 }
1190
1191 const char*
1192 DialogExportParameters::getFormatName()
1193 {
1194   return m_pRadioBoxFormat->getSelectionStringValue();
1195 }
1196
1197
1198 /////////////////////////////////////////////////////////////////////
1199 // CLASS DiaglogGetXYSize Implementation
1200 /////////////////////////////////////////////////////////////////////
1201
1202 DialogGetXYSize::DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize, int iDefaultYSize)
1203 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
1204 {
1205   m_iDefaultXSize = iDefaultXSize;
1206   m_iDefaultYSize = iDefaultYSize;
1207
1208   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
1209   
1210   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
1211   
1212   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1213   
1214   std::ostringstream os;
1215   os << iDefaultXSize;
1216   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1217   std::ostringstream osYSize;
1218   osYSize << iDefaultYSize;
1219   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1220   
1221   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
1222   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1223   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
1224   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1225   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
1226   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
1227   
1228   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1229   
1230   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1231   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1232   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1233   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1234   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1235   
1236   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1237   pButtonOk->SetDefault();
1238
1239   SetAutoLayout (true);
1240   SetSizer (pTopSizer);
1241   pTopSizer->Fit (this);
1242   pTopSizer->SetSizeHints (this);
1243 }
1244
1245 DialogGetXYSize::~DialogGetXYSize ()
1246 {
1247 }
1248
1249 unsigned int
1250 DialogGetXYSize::getXSize ()
1251 {
1252   wxString strCtrl = m_pTextCtrlXSize->GetValue();
1253   long lValue;
1254   if (strCtrl.ToLong (&lValue))
1255     return lValue;
1256   else
1257     return (m_iDefaultXSize);
1258 }
1259
1260 unsigned int
1261 DialogGetXYSize::getYSize ()
1262 {
1263   wxString strCtrl = m_pTextCtrlYSize->GetValue();
1264   long lValue;
1265   if (strCtrl.ToLong (&lValue))
1266     return lValue;
1267   else
1268     return (m_iDefaultYSize);
1269 }
1270
1271
1272
1273 /////////////////////////////////////////////////////////////////////
1274 // CLASS IDENTIFICATION
1275 //
1276 // DialogGetConvertPolarParameters
1277 /////////////////////////////////////////////////////////////////////
1278
1279 DialogGetConvertPolarParameters::DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle, 
1280        int iDefaultXSize, int iDefaultYSize, int iDefaultInterpolationID, int iDefaultZeropad)
1281 : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
1282 {
1283   m_iDefaultXSize = iDefaultXSize;
1284   m_iDefaultYSize = iDefaultYSize;
1285   m_iDefaultZeropad = iDefaultZeropad;
1286
1287   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
1288   
1289   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
1290   
1291   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1292   
1293   std::ostringstream os;
1294   os << iDefaultXSize;
1295   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1296   std::ostringstream osYSize;
1297   osYSize << iDefaultYSize;
1298   m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1299   
1300   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
1301   
1302   m_pRadioBoxInterpolation = new StringValueAndTitleRadioBox (this, _T("Interpolation"), Projections::getInterpCount(), Projections::getInterpTitleArray(), Projections::getInterpNameArray());
1303   m_pRadioBoxInterpolation->SetSelection (iDefaultInterpolationID);
1304   pGridSizer->Add (m_pRadioBoxInterpolation, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
1305   
1306   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1307   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1308   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1309   pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1310   if (iDefaultZeropad >= 0) {
1311     std::ostringstream osZeropad;
1312     osZeropad << iDefaultZeropad;
1313     m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
1314     pGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
1315     pGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
1316   }
1317   
1318   pTopSizer->Add (pGridSizer, 1, wxALL, 3);
1319   
1320   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
1321   
1322   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
1323   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
1324   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
1325   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
1326   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
1327   CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_POLAR);
1328   pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
1329   
1330   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
1331   pButtonOk->SetDefault();
1332   SetAutoLayout (true);
1333   SetSizer (pTopSizer);
1334   pTopSizer->Layout();
1335   pTopSizer->Fit (this);
1336   pTopSizer->SetSizeHints (this);
1337 }
1338
1339
1340 DialogGetConvertPolarParameters::~DialogGetConvertPolarParameters ()
1341 {
1342 }
1343
1344
1345 unsigned int
1346 DialogGetConvertPolarParameters::getXSize ()
1347 {
1348   wxString strCtrl = m_pTextCtrlXSize->GetValue();
1349   unsigned long lValue;
1350   if (strCtrl.ToULong (&lValue))
1351     return lValue;
1352   else
1353     return (m_iDefaultXSize);
1354 }
1355
1356 unsigned int
1357 DialogGetConvertPolarParameters::getYSize ()
1358 {
1359   wxString strCtrl = m_pTextCtrlYSize->GetValue();
1360   unsigned long lValue;
1361   if (strCtrl.ToULong (&lValue))
1362     return lValue;
1363   else
1364     return (m_iDefaultYSize);
1365 }
1366
1367 unsigned int
1368 DialogGetConvertPolarParameters::getZeropad ()
1369 {
1370   wxString strCtrl = m_pTextCtrlZeropad->GetValue();
1371   unsigned long lValue;
1372   if (strCtrl.ToULong (&lValue))
1373     return lValue;
1374   else
1375     return (m_iDefaultZeropad);
1376 }
1377
1378 const char*
1379 DialogGetConvertPolarParameters::getInterpolationName ()
1380 {
1381   return m_pRadioBoxInterpolation->getSelectionStringValue();
1382 }
1383