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