r311: image comparison functions
[ctsim.git] / src / dialogs.cpp
index 622efb29f56773e553b41ab8b7c6f486ee091345..7d8c0ecab7e7dbf3fd526e644476806382a40e6f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: dialogs.cpp,v 1.18 2000/12/20 20:08:48 kevin Exp $
+**  $Id: dialogs.cpp,v 1.20 2000/12/22 04:18:00 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -53,6 +53,9 @@
 #include "phantom.h"
 #include "filter.h"
 #include "backprojectors.h"
+#include "docs.h"\r
+#include "views.h"\r
+#include "imagefile.h"\r
 
 #if defined(MSVC) || HAVE_SSTREAM\r
 #include <sstream>\r
 #endif\r
 \r
 
+///////////////////////////////////////////////////////////////////////\r
+// CLASS IMPLEMENTATION\r
+//    StringValueAndTitleListBox\r
+///////////////////////////////////////////////////////////////////////\r
+\r
 StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[])
-  : wxListBox ()
+: wxListBox ()
 {
-    wxString* psTitle = new wxString [nChoices];
-    for (int i = 0; i < nChoices; i++)
-       psTitle[i] = aszTitle[i];
-
-    Create (pParent, -1, wxDefaultPosition, wxSize(200,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
-
-    m_ppszValues = aszValue;\r
-       delete [] psTitle;
+  wxString* psTitle = new wxString [nChoices];
+  for (int i = 0; i < nChoices; i++)
+    psTitle[i] = aszTitle[i];
+  
+  Create (pParent, -1, wxDefaultPosition, wxSize(200,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
+  
+  m_ppszValues = aszValue;\r
+  delete [] psTitle;
 };
 
 const char*
@@ -81,30 +89,34 @@ StringValueAndTitleListBox::getSelectionStringValue (void) const
 }
 
 
+///////////////////////////////////////////////////////////////////////\r
+// CLASS IMPLEMENTATION\r
+//    DialogGetPhantom\r
+///////////////////////////////////////////////////////////////////////\r
 
 DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom)
-    : wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+: wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
 {
   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
-
+  
   pTopSizer->Add (new wxStaticText (this, -1, "Select Phantom"), 0, wxALIGN_CENTER | wxALL, 5);
-                  
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
-
+  
   m_pListBoxPhantom = new StringValueAndTitleListBox (this, Phantom::getPhantomCount(), Phantom::getPhantomTitleArray(), Phantom::getPhantomNameArray());
   m_pListBoxPhantom->SetSelection (iDefaultPhantom);
   pTopSizer->Add (m_pListBoxPhantom, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
-
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
-
+  
   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
-
+  
   SetAutoLayout (true);
   SetSizer (pTopSizer);
   pTopSizer->Fit (this);
@@ -114,47 +126,114 @@ DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom)
 const char*
 DialogGetPhantom::getPhantom(void)
 {
-    return m_pListBoxPhantom->getSelectionStringValue();
+  return m_pListBoxPhantom->getSelectionStringValue();
 }
 
 \r
+///////////////////////////////////////////////////////////////////////\r
+// CLASS IMPLEMENTATION\r
+//    DialogGetComparisonImage\r
+///////////////////////////////////////////////////////////////////////\r
+\r
+DialogGetComparisonImage::DialogGetComparisonImage (wxFrame* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)\r
+: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rVecIF(rVecIF)\r
+{\r
+  wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);\r
+  \r
+  pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxALL, 5);\r
+  \r
+  pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);\r
+  \r
+  int iNImages = m_rVecIF.size();\r
+  wxString* pstrImages = new wxString [iNImages];\r
+  for (int i = 0; i < iNImages; i++) {\r
+    ImageFileView* pView = dynamic_cast<ImageFileView*>(m_rVecIF[i]->GetFirstView());\r
+    if (pView)\r
+      pstrImages[i] = pView->getFrame()->GetTitle();\r
+  }\r
+\r
+  m_pListBoxImageChoices = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, iNImages, pstrImages, wxLB_SINGLE);\r
+  delete [] pstrImages;\r
+\r
+  m_pListBoxImageChoices->SetSelection (0);\r
+  pTopSizer->Add (m_pListBoxImageChoices, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
+  \r
+  if (bShowMakeDifference) {\r
+    m_pMakeDifferenceImage = new wxCheckBox (this, -1, "Make Difference Image");\r
+    m_pMakeDifferenceImage->SetValue (FALSE);\r
+    pTopSizer->Add (m_pMakeDifferenceImage, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
+  } else\r
+    m_pMakeDifferenceImage = NULL;\r
+\r
+  pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
+  \r
+  wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);\r
+  wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");\r
+  wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");\r
+  pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);\r
+  pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);\r
+  \r
+  pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);\r
+  \r
+  SetAutoLayout (true);\r
+  SetSizer (pTopSizer);\r
+  pTopSizer->Fit (this);\r
+  pTopSizer->SetSizeHints (this);\r
+}\r
+\r
+ImageFileDocument*\r
+DialogGetComparisonImage::getImageFileDocument(void)\r
+{\r
+  return m_rVecIF[ m_pListBoxImageChoices->GetSelection() ];\r
+}\r
+\r
+bool\r
+DialogGetComparisonImage::getMakeDifferenceImage()\r
+{\r
+  if (m_pMakeDifferenceImage)\r
+    return m_pMakeDifferenceImage->GetValue();\r
+  else\r
+    return false;\r
+}\r
+\r
+\r
 /////////////////////////////////////////////////////////////////////\r
 // CLASS DiaglogGetMinMax Implementation\r
 /////////////////////////////////////////////////////////////////////\r
 
 DialogGetMinMax::DialogGetMinMax (wxFrame* pParent, const char* const pszTitle, double dDefaultMin, double dDefaultMax)
-    : wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
 {
   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
-
+  
   pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
-                  
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   std::ostringstream os;
   os << dDefaultMin;
   m_pTextCtrlMin = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
   std::ostringstream osMax;
   osMax << dDefaultMax;
   m_pTextCtrlMax = new wxTextCtrl (this, -1, osMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
-
+  
   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
   pGridSizer->Add (new wxStaticText (this, -1, "Minimum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlMin, 0, wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (new wxStaticText (this, -1, "Maximum"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlMax, 0, wxALIGN_CENTER_VERTICAL);
   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
-
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
-
+  
   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
-
+  
   SetAutoLayout (true);
   SetSizer (pTopSizer);
   pTopSizer->Fit (this);
@@ -168,23 +247,23 @@ DialogGetMinMax::~DialogGetMinMax (void)
 double
 DialogGetMinMax::getMinimum (void)
 {
-    wxString strCtrl = m_pTextCtrlMin->GetValue();
-    double dValue;
-    if (strCtrl.ToDouble (&dValue))
-       return dValue;
-    else
-       return (m_dDefaultMin);
+  wxString strCtrl = m_pTextCtrlMin->GetValue();
+  double dValue;
+  if (strCtrl.ToDouble (&dValue))
+    return dValue;
+  else
+    return (m_dDefaultMin);
 }
 
 double
 DialogGetMinMax::getMaximum (void)
 {
-    wxString strCtrl = m_pTextCtrlMax->GetValue();
-    double dValue;
-    if (strCtrl.ToDouble (&dValue))
-       return dValue;
-    else
-       return (m_dDefaultMax);
+  wxString strCtrl = m_pTextCtrlMax->GetValue();
+  double dValue;
+  if (strCtrl.ToDouble (&dValue))
+    return dValue;
+  else
+    return (m_dDefaultMax);
 }
 
 
@@ -193,23 +272,23 @@ DialogGetMinMax::getMaximum (void)
 /////////////////////////////////////////////////////////////////////\r
 \r
 DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor)\r
-  : wxDialog (pParent, -1, "Auto Scale Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_dMean(mean), m_dMode(mode), m_dMedian(median), m_dStdDev(stddev)\r
+: wxDialog (pParent, -1, "Auto Scale Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_dMean(mean), m_dMode(mode), m_dMedian(median), m_dStdDev(stddev)\r
 {\r
   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);\r
-\r
+  \r
   pTopSizer->Add (new wxStaticText (this, -1, "Auto Scale Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);\r
-                  \r
+  \r
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
-\r
+  \r
   wxString asTitle[3];\r
   asTitle[0] = "Median";\r
   asTitle[1] = "Mode";\r
   asTitle[2] = "Mean";\r
-\r
+  \r
   m_pListBoxCenter = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, 3, asTitle, wxLB_SINGLE | wxLB_NEEDED_SB);\r
   m_pListBoxCenter->SetSelection (0);\r
   pTopSizer->Add (m_pListBoxCenter, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
-\r
+  \r
   wxGridSizer *pGridSizer = new wxGridSizer (2);\r
   pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
   std::ostringstream osDefaultFactor;\r
@@ -217,17 +296,17 @@ DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, double m
   m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, osDefaultFactor.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);\r
   pGridSizer->Add (m_pTextCtrlStdDevFactor, 0, wxALIGN_CENTER_VERTICAL);\r
   pTopSizer->Add (pGridSizer, 1, wxALL, 10);\r
-\r
+  \r
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
-\r
+  \r
   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);\r
   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");\r
   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");\r
   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);\r
   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);\r
-\r
+  \r
   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);\r
-\r
+  \r
   SetAutoLayout (true);\r
   SetSizer (pTopSizer);\r
   pTopSizer->Fit (this);\r
@@ -248,13 +327,13 @@ DialogAutoScaleParameters::getMinMax (double* pMin, double* pMax)
   double dValue;\r
   if (! sStddevFactor.ToDouble (&dValue)) {\r
     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";\r
-       return false;\r
+    return false;\r
   }\r
   double dHalfWidth = dValue * m_dStdDev / 2;\r
   *pMin = dCenter - dHalfWidth;\r
   *pMax = dCenter + dHalfWidth;\r
   *theApp->getLog() << "Setting minimum to " << *pMin << " and maximum to " << *pMax << "\n";\r
-\r
+  \r
   return true;\r
 }\r
 \r
@@ -266,7 +345,7 @@ DialogAutoScaleParameters::getAutoScaleFactor ()
   if (! sStddevFactor.ToDouble (&dValue)) {\r
     *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";\r
   }\r
-\r
+  \r
   return dValue;\r
 }\r
 \r
@@ -278,14 +357,14 @@ DialogAutoScaleParameters::getAutoScaleFactor ()
 /////////////////////////////////////////////////////////////////////
 
 DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples)
-    : wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+: wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
 {
   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
-
+  
   pTopSizer->Add (new wxStaticText (this, -1, "Set Rasterization Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
-                  
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   std::ostringstream os;
   os << iDefaultXSize;
   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
@@ -295,7 +374,7 @@ DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDef
   std::ostringstream osNSamples;
   osNSamples << iDefaultNSamples;
   m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
-
+  
   wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
@@ -304,17 +383,17 @@ DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDef
   pGridSizer->Add (new wxStaticText (this, -1, "Samples per Pixel"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
-
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
-
+  
   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
-
+  
   SetAutoLayout (true);
   SetSizer (pTopSizer);
   pTopSizer->Fit (this);
@@ -329,35 +408,35 @@ DialogGetRasterParameters::~DialogGetRasterParameters (void)
 unsigned int
 DialogGetRasterParameters::getXSize (void)
 {
-    wxString strCtrl = m_pTextCtrlXSize->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultXSize);
+  wxString strCtrl = m_pTextCtrlXSize->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultXSize);
 }
 
 unsigned int
 DialogGetRasterParameters::getYSize (void)
 {
-    wxString strCtrl = m_pTextCtrlYSize->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultYSize);
+  wxString strCtrl = m_pTextCtrlYSize->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultYSize);
 }
 
 
 unsigned int
 DialogGetRasterParameters::getNSamples (void)
 {
-    wxString strCtrl = m_pTextCtrlNSamples->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultNSamples);
+  wxString strCtrl = m_pTextCtrlNSamples->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultNSamples);
 }
 
 
@@ -370,10 +449,10 @@ DialogGetRasterParameters::getNSamples (void)
 
 
 DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet, int iDefaultNView, int iDefaultNSamples, double dDefaultRotAngle, double dDefaultFocalLength, double dDefaultFieldOfView, int iDefaultGeometry, int iDefaultTrace)
-  : wxDialog (pParent, -1, "Set Projection Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+: wxDialog (pParent, -1, "Set Projection Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
 {
   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
-
+  
   m_dDefaultRotAngle = dDefaultRotAngle;
   m_dDefaultFocalLength = dDefaultFocalLength;
   m_dDefaultFieldOfView = dDefaultFieldOfView;
@@ -382,11 +461,11 @@ DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent,
   m_iDefaultNDet = iDefaultNDet;
   m_iDefaultTrace = iDefaultTrace;
   m_iDefaultGeometry = iDefaultGeometry;
-
+  
   pTopSizer->Add (new wxStaticText (this, -1, "Set Projection Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
-                  
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   std::ostringstream os;
   os << iDefaultNDet;
   m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
@@ -405,14 +484,14 @@ DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent,
   std::ostringstream osFieldOfView;
   osFieldOfView << dDefaultFieldOfView;
   m_pTextCtrlFieldOfView = new wxTextCtrl (this, -1, osFieldOfView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
-
+  
   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
   pGridSizer->Add (new wxStaticText (this, -1, "Scanner Geometry"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   m_pListBoxGeometry = new StringValueAndTitleListBox (this, Scanner::getGeometryCount(), Scanner::getGeometryTitleArray(), Scanner::getGeometryNameArray());
   m_pListBoxGeometry->SetSelection (iDefaultGeometry);
-
+  
   pGridSizer->Add (m_pListBoxGeometry, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
-
+  
   pGridSizer->Add (new wxStaticText (this, -1, "Detectors"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlNDet, 0, wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (new wxStaticText (this, -1, "Views"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
@@ -425,24 +504,24 @@ DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent,
   pGridSizer->Add (m_pTextCtrlFocalLength, 0, wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (new wxStaticText (this, -1, "Field of View (phantom diameter units)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlFieldOfView, 0, wxALIGN_CENTER_VERTICAL);
-
+  
   m_pListBoxTrace = new StringValueAndTitleListBox (this, Trace::getTraceCount(), Trace::getTraceTitleArray(), Trace::getTraceNameArray());
   m_pListBoxTrace->SetSelection (iDefaultTrace);
-
+  
   pGridSizer->Add (new wxStaticText (this, -1, "Trace Level"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pListBoxTrace, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
   pTopSizer->Add (pGridSizer, 1, wxALL, 10);
-
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
-
+  
   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
-
+  
   SetAutoLayout (true);
   SetSizer (pTopSizer);
   pTopSizer->Fit (this);
@@ -457,68 +536,68 @@ DialogGetProjectionParameters::~DialogGetProjectionParameters (void)
 unsigned int
 DialogGetProjectionParameters::getNDet (void)
 {
-    wxString strCtrl = m_pTextCtrlNDet->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultNDet);
+  wxString strCtrl = m_pTextCtrlNDet->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultNDet);
 }
 
 unsigned int
 DialogGetProjectionParameters::getNView (void)
 {
-    wxString strCtrl = m_pTextCtrlNView->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultNView);
+  wxString strCtrl = m_pTextCtrlNView->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultNView);
 }
 
 
 unsigned int
 DialogGetProjectionParameters::getNSamples (void)
 {
-    wxString strCtrl = m_pTextCtrlNSamples->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultNSamples);
+  wxString strCtrl = m_pTextCtrlNSamples->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultNSamples);
 }
 
 double
 DialogGetProjectionParameters::getRotAngle (void)
 {
-    wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
-    double dValue;
-    if (strCtrl.ToDouble (&dValue))
-       return (dValue * PI);
-    else
-      return (m_dDefaultRotAngle);
+  wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
+  double dValue;
+  if (strCtrl.ToDouble (&dValue))
+    return (dValue * PI);
+  else
+    return (m_dDefaultRotAngle);
 }
 
 double
 DialogGetProjectionParameters::getFocalLengthRatio (void)
 {
-    wxString strCtrl = m_pTextCtrlFocalLength->GetValue();
-    double dValue;
-    if (strCtrl.ToDouble (&dValue))
-       return (dValue);
-    else
-      return (m_dDefaultFocalLength);
+  wxString strCtrl = m_pTextCtrlFocalLength->GetValue();
+  double dValue;
+  if (strCtrl.ToDouble (&dValue))
+    return (dValue);
+  else
+    return (m_dDefaultFocalLength);
 }
 
 double
 DialogGetProjectionParameters::getFieldOfViewRatio (void)
 {
-    wxString strCtrl = m_pTextCtrlFieldOfView->GetValue();
-    double dValue;
-    if (strCtrl.ToDouble (&dValue))
-       return (dValue);
-    else
-      return (m_dDefaultFieldOfView);
+  wxString strCtrl = m_pTextCtrlFieldOfView->GetValue();
+  double dValue;
+  if (strCtrl.ToDouble (&dValue))
+    return (dValue);
+  else
+    return (m_dDefaultFieldOfView);
 }
 
 const char*
@@ -543,14 +622,14 @@ DialogGetProjectionParameters::getTrace (void)
 
 
 DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam,  int iDefaultFilterMethodID, int iDefaultFilterGenerationID, int iDefaultZeropad, int iDefaultInterpID, int iDefaultInterpParam, int iDefaultBackprojectID, int iTrace)
-    : wxDialog (pParent, -1, "Set Reconstruction Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+: wxDialog (pParent, -1, "Set Reconstruction Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
 {
   wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
-
+  
   pTopSizer->Add (new wxStaticText (this, -1, "Set Reconstruction Parameters"), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
-                  
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   std::ostringstream os;
   os << iDefaultXSize;
   m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
@@ -566,35 +645,35 @@ DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* p
   std::ostringstream osInterpParam;
   osInterpParam << iDefaultInterpParam;
   m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
-
+  
   wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (6);
   pGridSizer->Add (new wxStaticText (this, -1, "Filter"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
   m_pListBoxFilter = new StringValueAndTitleListBox (this, SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
   m_pListBoxFilter->SetSelection (iDefaultFilterID);
   pGridSizer->Add (m_pListBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
-
+  
   m_pListBoxFilterMethod = new StringValueAndTitleListBox (this, ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray());
   m_pListBoxFilterMethod->SetSelection (iDefaultFilterMethodID);
   pGridSizer->Add (new wxStaticText (this, -1, "Filter Method"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
   pGridSizer->Add (m_pListBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
-
+  
   m_pListBoxFilterGeneration = new StringValueAndTitleListBox (this, ProcessSignal::getFilterGenerationCount(), ProcessSignal::getFilterGenerationTitleArray(), ProcessSignal::getFilterGenerationNameArray());
   m_pListBoxFilterGeneration->SetSelection (iDefaultFilterGenerationID);
   pGridSizer->Add (new wxStaticText (this, -1, "Filter Generation"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
   pGridSizer->Add (m_pListBoxFilterGeneration, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
-\r
+  \r
   
   m_pListBoxBackproject = new StringValueAndTitleListBox (this, Backprojector::getBackprojectCount(), Backprojector::getBackprojectTitleArray(), Backprojector::getBackprojectNameArray());
   m_pListBoxBackproject->SetSelection (iDefaultBackprojectID);
   pGridSizer->Add (new wxStaticText (this, -1, "Backprojection"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
   pGridSizer->Add (m_pListBoxBackproject, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
-
+  
   m_pListBoxInterp = new StringValueAndTitleListBox (this, Backprojector::getInterpCount(), Backprojector::getInterpTitleArray(), Backprojector::getInterpNameArray());
   m_pListBoxInterp->SetSelection (iDefaultInterpID);
   pGridSizer->Add (new wxStaticText (this, -1, "Interpolation"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
   pGridSizer->Add (m_pListBoxInterp, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
-
-
+  
+  
   pGridSizer->Add (new wxStaticText (this, -1, "Trace Level"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);\r
   static const char* aszTraceTitle[] = {"None", "Full"};\r
   static const char* aszTraceName[] = {"none", "full"};\r
@@ -602,7 +681,7 @@ DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* p
   iTrace = clamp(iTrace, 0, 1);\r
   m_pListBoxTrace->SetSelection (iTrace);\r
   pGridSizer->Add (m_pListBoxTrace);\r
-\r
+  \r
   pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
@@ -613,19 +692,19 @@ DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* p
   pGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (new wxStaticText (this, -1, "Interpolation Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   pGridSizer->Add (m_pTextCtrlInterpParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
-
+  
   pTopSizer->Add (pGridSizer, 1, wxALL, 3);
-
+  
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
-
+  
   wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
   wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
   wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
   pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
   pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
-
+  
   pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
-
+  
   SetAutoLayout (true);
   SetSizer (pTopSizer);
   pTopSizer->Layout();
@@ -641,57 +720,57 @@ DialogGetReconstructionParameters::~DialogGetReconstructionParameters (void)
 unsigned int
 DialogGetReconstructionParameters::getXSize (void)
 {
-    wxString strCtrl = m_pTextCtrlXSize->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultXSize);
+  wxString strCtrl = m_pTextCtrlXSize->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultXSize);
 }
 
 unsigned int
 DialogGetReconstructionParameters::getYSize (void)
 {
-    wxString strCtrl = m_pTextCtrlYSize->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultYSize);
+  wxString strCtrl = m_pTextCtrlYSize->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultYSize);
 }
 
 unsigned int
 DialogGetReconstructionParameters::getZeropad (void)
 {
-    wxString strCtrl = m_pTextCtrlZeropad->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultZeropad);
+  wxString strCtrl = m_pTextCtrlZeropad->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultZeropad);
 }
 
 
 unsigned int
 DialogGetReconstructionParameters::getInterpParam (void)
 {
-    wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
-    unsigned long lValue;
-    if (strCtrl.ToULong (&lValue))
-       return lValue;
-    else
-       return (m_iDefaultInterpParam);
+  wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
+  unsigned long lValue;
+  if (strCtrl.ToULong (&lValue))
+    return lValue;
+  else
+    return (m_iDefaultInterpParam);
 }
 
 double
 DialogGetReconstructionParameters::getFilterParam (void)
 {
-    wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
-    double dValue;
-    if (strCtrl.ToDouble (&dValue))
-       return (dValue);
-    else
-      return (m_dDefaultFilterParam);
+  wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
+  double dValue;
+  if (strCtrl.ToDouble (&dValue))
+    return (dValue);
+  else
+    return (m_dDefaultFilterParam);
 }
 
 const char*
@@ -717,7 +796,7 @@ DialogGetReconstructionParameters::getTrace (void)
 {
   int iTrace = 0;
   if (strcmp("full", m_pListBoxTrace->getSelectionStringValue()) == 0)
-      iTrace = Trace::TRACE_PLOT;
+    iTrace = Trace::TRACE_PLOT;
   return iTrace;
 }