+DialogGetReconstructionParameters::getBackprojectName ()
+{
+ if (theApp->getAdvancedOptions()) {
+ return m_pRadioBoxBackproject->getSelectionStringValue();
+ } else
+ return "idiff";
+}
+
+const char*
+DialogGetReconstructionParameters::getFilterGenerationName ()
+{
+ if (theApp->getAdvancedOptions()) {
+ return m_pRadioBoxFilterGeneration->getSelectionStringValue();
+ } else {
+ if (ProcessSignal::convertFilterMethodNameToID(m_pRadioBoxFilterMethod->getSelectionStringValue())
+ == ProcessSignal::FILTER_METHOD_CONVOLUTION)
+ return "direct";
+ else
+ return "inverse-fourier";
+ }
+}
+
+void
+DialogGetReconstructionParameters::getROI (ReconstructionROI* pROI)
+{
+ if (theApp->getAdvancedOptions()) {
+ double dValue;
+ if (m_pTextCtrlRoiXMin->GetValue().ToDouble (&dValue))
+ pROI->m_dXMin = dValue;
+ else
+ pROI->m_dXMin = m_dDefaultRoiXMin;
+
+ if (m_pTextCtrlRoiXMax->GetValue().ToDouble (&dValue))
+ pROI->m_dXMax = dValue;
+ else
+ pROI->m_dXMax = m_dDefaultRoiXMax;
+
+ if (m_pTextCtrlRoiYMin->GetValue().ToDouble (&dValue))
+ pROI->m_dYMin = dValue;
+ else
+ pROI->m_dYMin = m_dDefaultRoiYMin;
+
+ if (m_pTextCtrlRoiYMax->GetValue().ToDouble (&dValue))
+ pROI->m_dYMax = dValue;
+ else
+ pROI->m_dYMax = m_dDefaultRoiYMax;
+ } else {
+ pROI->m_dXMin = m_dDefaultRoiXMin;
+ pROI->m_dXMax = m_dDefaultRoiXMax;
+ pROI->m_dYMin = m_dDefaultRoiYMin;
+ pROI->m_dYMax = m_dDefaultRoiYMax;
+ }
+}
+
+/////////////////////////////////////////////////////////////////////
+// CLASS IDENTIFICATION
+//
+// DialogGetFilterParameters
+/////////////////////////////////////////////////////////////////////
+
+
+
+DialogGetFilterParameters::DialogGetFilterParameters (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam, double dDefaultBandwidth, int iDefaultDomainID, double dDefaultInputScale, double dDefaultOutputScale)
+: wxDialog (pParent, -1, _T("Filter Parameters"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ pTopSizer->Add (new wxStaticText (this, -1, _T("Filter Parameters")), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+
+ wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
+
+ m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
+ m_pRadioBoxFilter->SetSelection (iDefaultFilterID);
+ pGridSizer->Add (m_pRadioBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
+
+ m_pRadioBoxDomain = new StringValueAndTitleRadioBox (this, _T("Domain"), SignalFilter::getDomainCount(), SignalFilter::getDomainTitleArray(), SignalFilter::getDomainNameArray());
+ m_pRadioBoxDomain->SetSelection (iDefaultDomainID);
+ pGridSizer->Add (m_pRadioBoxDomain, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
+
+ wxString sXSize;
+ sXSize << iDefaultXSize;
+ m_pTextCtrlXSize = new wxTextCtrl (this, -1, sXSize, wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, _T("X Size")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ wxString sYSize;
+ sYSize << iDefaultYSize;
+ m_pTextCtrlYSize = new wxTextCtrl (this, -1, sYSize, wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, _T("Y Size")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ wxString sFilterParam;
+ sFilterParam << dDefaultFilterParam;
+ m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, sFilterParam, wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, _T("Filter Parameter")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ wxString sBandwidth;
+ sBandwidth << dDefaultBandwidth;
+ m_pTextCtrlBandwidth = new wxTextCtrl (this, -1, sBandwidth, wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, _T("Bandwidth")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlBandwidth, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ wxString sInputScale;
+ sInputScale << dDefaultInputScale;
+ m_pTextCtrlInputScale = new wxTextCtrl (this, -1, sInputScale, wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, _T("Axis (input) Scale")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlInputScale, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ wxString sOutputScale;
+ sOutputScale << dDefaultOutputScale;
+ m_pTextCtrlOutputScale = new wxTextCtrl (this, -1, sOutputScale, wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, _T("Filter Output Scale")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlOutputScale, 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, _T("Okay"));
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, _T("Cancel"));
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_FILTER);
+ pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
+
+ pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
+ pButtonOk->SetDefault();
+
+ SetAutoLayout (true);
+ SetSizer (pTopSizer);
+ pTopSizer->Layout();
+ pTopSizer->Fit (this);
+ pTopSizer->SetSizeHints (this);
+}
+
+DialogGetFilterParameters::~DialogGetFilterParameters ()
+{
+}
+
+
+unsigned int
+DialogGetFilterParameters::getXSize ()
+{
+ wxString strCtrl = m_pTextCtrlXSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultXSize);
+}
+
+unsigned int
+DialogGetFilterParameters::getYSize ()
+{
+ wxString strCtrl = m_pTextCtrlYSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultYSize);
+}
+
+double
+DialogGetFilterParameters::getBandwidth ()
+{
+ wxString strCtrl = m_pTextCtrlBandwidth->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return dValue;
+ else
+ return (m_dDefaultBandwidth);
+}
+
+double
+DialogGetFilterParameters::getFilterParam ()
+{
+ wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return (dValue);
+ else
+ return (m_dDefaultFilterParam);
+}
+
+double
+DialogGetFilterParameters::getInputScale ()
+{
+ wxString strCtrl = m_pTextCtrlInputScale->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return dValue;
+ else
+ return (m_dDefaultInputScale);
+}
+
+double
+DialogGetFilterParameters::getOutputScale ()
+{
+ wxString strCtrl = m_pTextCtrlOutputScale->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return dValue;
+ else
+ return (m_dDefaultOutputScale);
+}
+
+const char*
+DialogGetFilterParameters::getFilterName ()
+{
+ return m_pRadioBoxFilter->getSelectionStringValue();
+}
+
+const char*
+DialogGetFilterParameters::getDomainName ()
+{
+ return m_pRadioBoxDomain->getSelectionStringValue();
+}
+
+
+///////////////////////////////////////////////////////////////////////
+// CLASS IMPLEMENTATION
+// DialogExportParameters
+///////////////////////////////////////////////////////////////////////
+
+DialogExportParameters::DialogExportParameters (wxWindow* pParent, int iDefaultFormatID)
+: wxDialog (pParent, -1, _T("Select ExportParameters"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ pTopSizer->Add (new wxStaticText (this, -1, _T("Select Export Format")), 0, wxALIGN_CENTER | wxALL, 5);
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
+
+ m_pRadioBoxFormat = new StringValueAndTitleRadioBox (this, _T("File Type"),
+ ImageFile::getExportFormatCount(), ImageFile::getExportFormatTitleArray(), ImageFile::getExportFormatNameArray());
+ m_pRadioBoxFormat->SetSelection (iDefaultFormatID);
+ pTopSizer->Add (m_pRadioBoxFormat, 0, wxALL | wxALIGN_CENTER);
+
+ 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, _T("Okay"));
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, _T("Cancel"));
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_EXPORT);
+ pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
+
+ pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
+ pButtonOk->SetDefault();
+
+ SetAutoLayout (true);
+ SetSizer (pTopSizer);
+ pTopSizer->Fit (this);
+ pTopSizer->SetSizeHints (this);
+}
+
+const char*
+DialogExportParameters::getFormatName()
+{
+ return m_pRadioBoxFormat->getSelectionStringValue();
+}
+
+
+///////////////////////////////////////////////////////////////////////
+// CLASS IMPLEMENTATION
+// DialogImportParameters
+///////////////////////////////////////////////////////////////////////
+
+DialogImportParameters::DialogImportParameters (wxWindow* pParent, int iDefaultFormatID)
+: wxDialog (pParent, -1, _T("Select Import Parameters"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)