+ int selection = m_pListBoxGeometry->GetSelection();
+ if (selection >= 0)
+ return (s_asGeometry[selection]);
+
+ return m_sDefaultGeometry;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////
+// CLASS IDENTIFICATION
+//
+// DialogGetReconstructionParameters
+/////////////////////////////////////////////////////////////////////
+
+const wxString DialogGetReconstructionParameters::s_asFilter[] =
+{
+ wxString(SignalFilter::FILTER_ABS_BANDLIMIT_STR),
+ wxString(SignalFilter::FILTER_SHEPP_STR),
+};
+const wxString DialogGetReconstructionParameters::s_asFilterTitle[] =
+{
+ wxString(SignalFilter::FILTER_ABS_BANDLIMIT_TITLE_STR),
+ wxString(SignalFilter::FILTER_SHEPP_TITLE_STR),
+};
+const unsigned int DialogGetReconstructionParameters::s_iNumFilter = sizeof(s_asFilter) / sizeof(wxString);
+
+
+const wxString DialogGetReconstructionParameters::s_asInterp[] =
+{
+ wxString(Backprojector::INTERP_NEAREST_STR),
+ wxString(Backprojector::INTERP_LINEAR_STR),
+};
+const wxString DialogGetReconstructionParameters::s_asInterpTitle[] =
+{
+ wxString(Backprojector::INTERP_NEAREST_TITLE_STR),
+ wxString(Backprojector::INTERP_LINEAR_TITLE_STR),
+ };
+const unsigned int DialogGetReconstructionParameters::s_iNumInterp = sizeof(s_asInterp) / sizeof(wxString);
+
+
+DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, const char* szDefaultFilterName = NULL, double dDefaultFilterParam = 1., const char* szDefaultFilterMethodName = NULL, int iDefaultZeropad = 3, const char* szDefaultInterpName = NULL, int iDefaultInterpParam = 1, const char* szDefaultBackprojName = NULL)
+ : 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);
+
+ m_pListBoxFilter = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, s_iNumFilter, s_asFilterTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
+ pTopSizer->Add (m_pListBoxFilter, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
+
+ m_pListBoxInterp = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, s_iNumInterp, s_asInterpTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
+ pTopSizer->Add (m_pListBoxInterp, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
+
+ ostringstream os;
+ os << iDefaultXSize;
+ m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ ostringstream osYSize;
+ osYSize << iDefaultYSize;
+ m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ ostringstream osFilterParam;
+ osFilterParam << dDefaultFilterParam;
+ m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ ostringstream osZeropad;
+ osZeropad << iDefaultZeropad;
+ m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ ostringstream osInterpParam;
+ osInterpParam << iDefaultInterpParam;
+ m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+
+ wxGridSizer *pGridSizer = new wxGridSizer (2, 5, 5);
+ pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (new wxStaticText (this, -1, "Filter Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (new wxStaticText (this, -1, "Interpolation Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlInterpParam, 0, wxALIGN_CENTER_VERTICAL);
+ pTopSizer->Add (pGridSizer, 1, wxALL, 10);
+
+ m_sDefaultFilterName = szDefaultFilterName;
+ m_sDefaultFilterMethodName = szDefaultFilterMethodName;
+ m_sDefaultInterpName = szDefaultInterpName;
+ m_sDefaultBackprojName = szDefaultBackprojName;
+
+ 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);
+ pTopSizer->SetSizeHints (this);
+}
+
+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);
+}
+
+unsigned int
+DialogGetReconstructionParameters::getYSize (void)
+{
+ 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);
+}
+
+
+unsigned int
+DialogGetReconstructionParameters::getInterpParam (void)
+{
+ 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);
+}
+
+const wxString&
+DialogGetReconstructionParameters::getFilterName (void)
+{
+ int selection = m_pListBoxFilter->GetSelection();
+ if (selection >= 0)
+ return (s_asFilter[selection]);
+
+ return m_sDefaultFilterName;
+}
+
+const wxString&
+DialogGetReconstructionParameters::getFilterMethodName (void)
+{
+ return m_sDefaultFilterMethodName;
+}
+
+const wxString&
+DialogGetReconstructionParameters::getInterpName (void)
+{
+ int selection = m_pListBoxInterp->GetSelection();
+ if (selection >= 0)
+ return (s_asInterp[selection]);
+
+ return m_sDefaultInterpName;
+}
+
+const wxString&
+DialogGetReconstructionParameters::getBackprojName (void)
+{
+ return m_sDefaultBackprojName;