+
+ wxString asTitle[] = {"Mode", "Median", "Mean"};
+
+ m_pRadioBoxCenter = new wxRadioBox (this, -1, _T("Center"), wxDefaultPosition, wxDefaultSize, 3, asTitle, 1, wxRA_SPECIFY_COLS);
+ m_pRadioBoxCenter->SetSelection (0);
+ pTopSizer->Add (m_pRadioBoxCenter, 0, wxALL | wxALIGN_CENTER);
+
+ wxGridSizer *pGridSizer = new wxGridSizer (2);
+ pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osDefaultFactor;
+ osDefaultFactor << dDefaultScaleFactor;
+ m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, osDefaultFactor.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (m_pTextCtrlStdDevFactor, 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");
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_AUTOSCALE);
+ 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);
+}
+
+bool
+DialogAutoScaleParameters::getMinMax (double* pMin, double* pMax)
+{
+ int iCenter = m_pRadioBoxCenter->GetSelection();
+ double dCenter = m_dMode;
+ if (iCenter == 1)
+ dCenter = m_dMedian;
+ else if (iCenter == 2)
+ dCenter = m_dMean;
+
+ wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
+ double dValue;
+ if (! sStddevFactor.ToDouble (&dValue)) {
+ *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";
+ return false;
+ }
+ double dHalfWidth = dValue * m_dStdDev / 2;
+ *pMin = dCenter - dHalfWidth;
+ *pMax = dCenter + dHalfWidth;
+ *theApp->getLog() << "Setting minimum to " << *pMin << " and maximum to " << *pMax << "\n";
+
+ return true;
+}
+
+double
+DialogAutoScaleParameters::getAutoScaleFactor ()
+{
+ wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
+ double dValue = 1.;
+ if (! sStddevFactor.ToDouble (&dValue)) {
+ *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";
+ }
+
+ return dValue;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////
+// CLASS IDENTIFICATION
+//
+// DialogGetRasterParameters
+/////////////////////////////////////////////////////////////////////
+
+DialogGetRasterParameters::DialogGetRasterParameters
+ (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples, double dDefaultViewRatio)
+: wxDialog (pParent, -1, _T("Rasterization Parameters"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ pTopSizer->Add (new wxStaticText (this, -1, "Rasterization 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);
+ std::ostringstream os;
+ os << iDefaultXSize;
+ m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osYSize;
+ osYSize << iDefaultYSize;
+ m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osViewRatio;
+ osViewRatio << dDefaultViewRatio;
+ m_pTextCtrlViewRatio = new wxTextCtrl (this, -1, osViewRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, "View Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlViewRatio, 0, wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osNSamples;
+ osNSamples << iDefaultNSamples;
+ m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ 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");
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_RASTERIZE);
+ 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);
+}
+
+DialogGetRasterParameters::~DialogGetRasterParameters ()
+{
+}
+
+
+unsigned int
+DialogGetRasterParameters::getXSize ()
+{
+ wxString strCtrl = m_pTextCtrlXSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultXSize);
+}
+
+unsigned int
+DialogGetRasterParameters::getYSize ()
+{
+ wxString strCtrl = m_pTextCtrlYSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultYSize);
+}
+
+unsigned int
+DialogGetRasterParameters::getNSamples ()
+{
+ wxString strCtrl = m_pTextCtrlNSamples->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultNSamples);
+}
+
+double
+DialogGetRasterParameters::getViewRatio ()
+{
+ wxString strCtrl = m_pTextCtrlViewRatio->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return dValue;
+ else
+ return (m_dDefaultViewRatio);
+}
+
+
+/////////////////////////////////////////////////////////////////////
+// CLASS IDENTIFICATION
+//
+// DialogGetProjectionParameters
+/////////////////////////////////////////////////////////////////////
+
+
+DialogGetProjectionParameters::DialogGetProjectionParameters
+ (wxWindow* pParent, int iDefaultNDet, int iDefaultNView, int iDefaultNSamples,
+ double dDefaultRotAngle, double dDefaultFocalLength, double dDefaultCenterDetectorLength,
+ double dDefaultViewRatio, double dDefaultScanRatio, int iDefaultGeometry, int iDefaultTrace)
+: wxDialog (pParent, -1, _T("Projection Parameters"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ m_dDefaultRotAngle = dDefaultRotAngle;
+ m_dDefaultFocalLength = dDefaultFocalLength;
+ m_dDefaultCenterDetectorLength = dDefaultCenterDetectorLength;
+ m_dDefaultViewRatio = dDefaultViewRatio;
+ m_dDefaultScanRatio = dDefaultScanRatio;
+ m_iDefaultNSamples = iDefaultNSamples;
+ m_iDefaultNView = iDefaultNView;
+ m_iDefaultNDet = iDefaultNDet;
+ m_iDefaultTrace = iDefaultTrace;
+ m_iDefaultGeometry = iDefaultGeometry;
+
+ pTopSizer->Add (new wxStaticText (this, -1, "Projection 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_pRadioBoxGeometry = new StringValueAndTitleRadioBox (this, _T("Geometry"), Scanner::getGeometryCount(), Scanner::getGeometryTitleArray(), Scanner::getGeometryNameArray());
+ m_pRadioBoxGeometry->SetSelection (iDefaultGeometry);
+
+ pGridSizer->Add (m_pRadioBoxGeometry, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
+
+ m_pRadioBoxTrace = new StringValueAndTitleRadioBox (this, _T("Trace Level"), Trace::getTraceCount(), Trace::getTraceTitleArray(), Trace::getTraceNameArray());
+ m_pRadioBoxTrace->SetSelection (iDefaultTrace);
+ pGridSizer->Add (m_pRadioBoxTrace, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
+
+ wxFlexGridSizer* pText1Sizer = new wxFlexGridSizer(2);
+ std::ostringstream os;
+ os << iDefaultNDet;
+ m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText1Sizer->Add (new wxStaticText (this, -1, "Detectors"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText1Sizer->Add (m_pTextCtrlNDet, 0, wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osNView;
+ osNView << iDefaultNView;
+ m_pTextCtrlNView = new wxTextCtrl (this, -1, osNView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText1Sizer->Add (new wxStaticText (this, -1, "Views"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText1Sizer->Add (m_pTextCtrlNView, 0, wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osNSamples;
+ osNSamples << iDefaultNSamples;
+ m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText1Sizer->Add (new wxStaticText (this, -1, "Samples per Detector"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText1Sizer->Add (m_pTextCtrlNSamples, 0, wxALIGN_CENTER_VERTICAL);
+
+ pGridSizer->Add (pText1Sizer);
+
+ wxFlexGridSizer* pText2Sizer = new wxFlexGridSizer(2);
+ std::ostringstream osViewRatio;
+ osViewRatio << dDefaultViewRatio;
+ m_pTextCtrlViewRatio = new wxTextCtrl (this, -1, osViewRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText2Sizer->Add (new wxStaticText (this, -1, "View Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText2Sizer->Add (m_pTextCtrlViewRatio, 0, wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osScanRatio;
+ osScanRatio << dDefaultScanRatio;
+ m_pTextCtrlScanRatio = new wxTextCtrl (this, -1, osScanRatio.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText2Sizer->Add (new wxStaticText (this, -1, "Scan Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText2Sizer->Add (m_pTextCtrlScanRatio, 0, wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osFocalLength;
+ osFocalLength << dDefaultFocalLength;
+ m_pTextCtrlFocalLength = new wxTextCtrl (this, -1, osFocalLength.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText2Sizer->Add (new wxStaticText (this, -1, "Focal Length Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText2Sizer->Add (m_pTextCtrlFocalLength, 0, wxALIGN_CENTER_VERTICAL);
+
+ if (theApp->getAdvancedOptions()) {
+ std::ostringstream osCenterDetectorLength;
+ osCenterDetectorLength << dDefaultCenterDetectorLength;
+ m_pTextCtrlCenterDetectorLength = new wxTextCtrl (this, -1, osCenterDetectorLength.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText2Sizer->Add (new wxStaticText (this, -1, "Center-Detector Length Ratio"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText2Sizer->Add (m_pTextCtrlCenterDetectorLength, 0, wxALIGN_CENTER_VERTICAL);
+
+ std::ostringstream osRotAngle;
+ osRotAngle << dDefaultRotAngle;
+ m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pText2Sizer->Add (new wxStaticText (this, -1, "Rotation Angle (Fraction of circle)"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pText2Sizer->Add (m_pTextCtrlRotAngle, 0, wxALIGN_CENTER_VERTICAL);
+ }
+ pGridSizer->Add (pText2Sizer);
+
+ 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");
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PROJECTIONS);
+ 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);
+
+ m_pRadioBoxGeometry->SetFocus();
+}
+
+DialogGetProjectionParameters::~DialogGetProjectionParameters ()
+{
+}
+
+
+unsigned int
+DialogGetProjectionParameters::getNDet ()
+{
+ wxString strCtrl = m_pTextCtrlNDet->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultNDet);
+}
+
+unsigned int
+DialogGetProjectionParameters::getNView ()
+{
+ wxString strCtrl = m_pTextCtrlNView->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultNView);
+}
+
+
+unsigned int
+DialogGetProjectionParameters::getNSamples ()
+{
+ wxString strCtrl = m_pTextCtrlNSamples->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultNSamples);
+}
+
+double
+DialogGetProjectionParameters::getRotAngle ()
+{
+ if (theApp->getAdvancedOptions()) {
+ wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return (dValue * TWOPI);
+ else
+ return (m_dDefaultRotAngle);
+ } else {
+ if (Scanner::convertGeometryNameToID (m_pRadioBoxGeometry->getSelectionStringValue()) ==
+ Scanner::GEOMETRY_PARALLEL)
+ return (PI);
+ else
+ return (TWOPI);
+ }
+}
+
+double
+DialogGetProjectionParameters::getFocalLengthRatio ()
+{
+ wxString strCtrl = m_pTextCtrlFocalLength->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return (dValue);
+ else
+ return (m_dDefaultFocalLength);
+}
+
+double
+DialogGetProjectionParameters::getCenterDetectorLengthRatio ()
+{
+ if (theApp->getAdvancedOptions()) {
+ wxString strCtrl = m_pTextCtrlCenterDetectorLength->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return (dValue);
+ else
+ return (m_dDefaultCenterDetectorLength);
+ } else
+ return getFocalLengthRatio(); // default is to set equal to focal-length
+}
+
+double
+DialogGetProjectionParameters::getViewRatio ()
+{
+ wxString strCtrl = m_pTextCtrlViewRatio->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return (dValue);
+ else
+ return (m_dDefaultViewRatio);
+}
+
+double
+DialogGetProjectionParameters::getScanRatio ()
+{
+ wxString strCtrl = m_pTextCtrlScanRatio->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return (dValue);
+ else
+ return (m_dDefaultScanRatio);
+}
+
+const char*
+DialogGetProjectionParameters::getGeometry ()
+{
+ return m_pRadioBoxGeometry->getSelectionStringValue();
+}
+
+int
+DialogGetProjectionParameters::getTrace ()
+{
+ return Trace::convertTraceNameToID(m_pRadioBoxTrace->getSelectionStringValue());
+}
+
+
+
+/////////////////////////////////////////////////////////////////////
+// CLASS IDENTIFICATION
+//
+// DialogGetReconstructionParameters
+/////////////////////////////////////////////////////////////////////
+
+
+DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxWindow* pParent, int iDefaultXSize,
+ int iDefaultYSize, int iDefaultFilterID, double dDefaultHammingParam,
+ int iDefaultFilterMethodID, int iDefaultFilterGenerationID, int iDefaultZeropad,
+ int iDefaultInterpID, int iDefaultInterpParam, int iDefaultBackprojectID, int iTrace,
+ ReconstructionROI* pDefaultROI)
+: wxDialog (pParent, -1, _T("Reconstruction Parameters"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ m_iDefaultXSize = iDefaultXSize;
+ m_iDefaultYSize = iDefaultYSize;
+ m_dDefaultFilterParam = dDefaultHammingParam;
+ m_iDefaultZeropad = iDefaultZeropad;
+ m_iDefaultInterpParam = iDefaultInterpParam;
+ m_dDefaultRoiXMin = pDefaultROI->m_dXMin;
+ m_dDefaultRoiXMax = pDefaultROI->m_dXMax;
+ m_dDefaultRoiYMin = pDefaultROI->m_dYMin;
+ m_dDefaultRoiYMax = pDefaultROI->m_dYMax;
+
+ pTopSizer->Add (new wxStaticText (this, -1, "Filtered Backprojection 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 = NULL;
+ if (theApp->getAdvancedOptions())
+ pGridSizer = new wxFlexGridSizer (4);
+ else
+ pGridSizer = new wxFlexGridSizer (3);
+
+ if (theApp->getAdvancedOptions())
+ m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
+ else
+ m_pRadioBoxFilter = new StringValueAndTitleRadioBox (this, _T("Filter"), SignalFilter::getReconstructFilterCount(), SignalFilter::getFilterTitleArray(), SignalFilter::getFilterNameArray());
+ m_pRadioBoxFilter->SetSelection (iDefaultFilterID);
+ pGridSizer->Add (m_pRadioBoxFilter, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
+
+ if (theApp->getAdvancedOptions()) {
+ m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), ProcessSignal::getFilterMethodCount(), ProcessSignal::getFilterMethodTitleArray(), ProcessSignal::getFilterMethodNameArray());
+ m_pRadioBoxFilterMethod->SetSelection (iDefaultFilterMethodID);
+ pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
+ } else {
+#if HAVE_FFTW
+ static const char* aszFilterMethodTitle[] = {"Convolution", "FFT"};
+ static const char* aszFilterMethodName[] = {"convolution", "rfftw"};
+#else
+ static const char* aszFilterMethodTitle[] = {"Convolution", "Fourier"};
+ static const char* aszFilterMethodName[] = {"convolution", "fourier-table"};
+#endif
+ m_pRadioBoxFilterMethod = new StringValueAndTitleRadioBox (this, _T("Filter Method"), 2, aszFilterMethodTitle, aszFilterMethodName);
+#if HAVE_FFTW
+ m_pRadioBoxFilterMethod->SetSelection (1);
+#else
+ m_pRadioBoxFilterMethod->SetSelection (0);
+#endif
+ pGridSizer->Add (m_pRadioBoxFilterMethod, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
+ }
+
+ if (theApp->getAdvancedOptions()) {
+ m_pRadioBoxFilterGeneration = new StringValueAndTitleRadioBox (this, _T("Filter Generation"), ProcessSignal::getFilterGenerationCount(), ProcessSignal::getFilterGenerationTitleArray(), ProcessSignal::getFilterGenerationNameArray());
+ m_pRadioBoxFilterGeneration->SetSelection (iDefaultFilterGenerationID);
+ pGridSizer->Add (m_pRadioBoxFilterGeneration, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
+
+ m_pRadioBoxBackproject = new StringValueAndTitleRadioBox (this, _T("Backprojection"), Backprojector::getBackprojectCount(), Backprojector::getBackprojectTitleArray(), Backprojector::getBackprojectNameArray());
+ m_pRadioBoxBackproject->SetSelection (iDefaultBackprojectID);
+ pGridSizer->Add (m_pRadioBoxBackproject, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
+ }
+
+ m_pRadioBoxInterp = new StringValueAndTitleRadioBox (this, _T("Interpolation"), Backprojector::getInterpCount(), Backprojector::getInterpTitleArray(), Backprojector::getInterpNameArray());
+ m_pRadioBoxInterp->SetSelection (iDefaultInterpID);
+ pGridSizer->Add (m_pRadioBoxInterp, 0, wxALL | wxALIGN_RIGHT | wxEXPAND);
+
+ static const char* aszTraceTitle[] = {"None", "Full"};
+ static const char* aszTraceName[] = {"none", "full"};
+ m_pRadioBoxTrace = new StringValueAndTitleRadioBox (this, _T("Trace Level"), 2, aszTraceTitle, aszTraceName);
+ iTrace = clamp(iTrace, 0, 1);
+ m_pRadioBoxTrace->SetSelection (iTrace);
+ pGridSizer->Add (m_pRadioBoxTrace);
+
+ wxFlexGridSizer* pTextGridSizer = new wxFlexGridSizer (2);
+ std::ostringstream os;
+ os << iDefaultXSize;
+ m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pTextGridSizer->Add (new wxStaticText (this, -1, "X Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pTextGridSizer->Add (m_pTextCtrlXSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osYSize;
+ osYSize << iDefaultYSize;
+ m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pTextGridSizer->Add (new wxStaticText (this, -1, "Y Size"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pTextGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ std::ostringstream osHammingParam;
+ osHammingParam << dDefaultHammingParam;
+ m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osHammingParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pTextGridSizer->Add (new wxStaticText (this, -1, "Hamming Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pTextGridSizer->Add (m_pTextCtrlFilterParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ if (theApp->getAdvancedOptions()) {
+ std::ostringstream osZeropad;
+ osZeropad << iDefaultZeropad;
+ m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pTextGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pTextGridSizer->Add (m_pTextCtrlZeropad, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ }
+ pGridSizer->Add (pTextGridSizer);
+
+#if HAVE_FREQ_PREINTERP
+ std::ostringstream osInterpParam;
+ osInterpParam << iDefaultInterpParam;
+ m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, "Interpolation Parameter"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlInterpParam, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+#endif
+
+ if (theApp->getAdvancedOptions()) {
+ wxFlexGridSizer* pROIGridSizer = new wxFlexGridSizer (2);
+ std::ostringstream osRoiXMin;
+ osRoiXMin << m_dDefaultRoiXMin;
+ m_pTextCtrlRoiXMin = new wxTextCtrl (this, -1, osRoiXMin.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pROIGridSizer->Add (new wxStaticText (this, -1, "ROI XMin"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pROIGridSizer->Add (m_pTextCtrlRoiXMin, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osRoiXMax;
+ osRoiXMax << m_dDefaultRoiXMax;
+ m_pTextCtrlRoiXMax = new wxTextCtrl (this, -1, osRoiXMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pROIGridSizer->Add (new wxStaticText (this, -1, "ROI XMax"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pROIGridSizer->Add (m_pTextCtrlRoiXMax, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osRoiYMin;
+ osRoiYMin << m_dDefaultRoiYMin;
+ m_pTextCtrlRoiYMin = new wxTextCtrl (this, -1, osRoiYMin.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pROIGridSizer->Add (new wxStaticText (this, -1, "ROI YMin"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pROIGridSizer->Add (m_pTextCtrlRoiYMin, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ std::ostringstream osRoiYMax;
+ osRoiYMax << m_dDefaultRoiYMax;
+ m_pTextCtrlRoiYMax = new wxTextCtrl (this, -1, osRoiYMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pROIGridSizer->Add (new wxStaticText (this, -1, "ROI YMax"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pROIGridSizer->Add (m_pTextCtrlRoiYMax, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+
+ pGridSizer->Add (pROIGridSizer);
+ }
+
+ 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");
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_RECONSTRUCTION);
+ 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);
+}
+
+DialogGetReconstructionParameters::~DialogGetReconstructionParameters ()
+{
+}
+
+
+unsigned int
+DialogGetReconstructionParameters::getXSize ()
+{
+ wxString strCtrl = m_pTextCtrlXSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultXSize);
+}
+
+unsigned int
+DialogGetReconstructionParameters::getYSize ()
+{
+ wxString strCtrl = m_pTextCtrlYSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultYSize);
+}
+
+unsigned int
+DialogGetReconstructionParameters::getZeropad ()
+{
+ if (theApp->getAdvancedOptions()) {
+ wxString strCtrl = m_pTextCtrlZeropad->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultZeropad);
+ } else
+ return 1;
+}
+
+
+unsigned int
+DialogGetReconstructionParameters::getInterpParam ()
+{
+#if HAVE_FREQ_PREINTERP
+ wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultInterpParam);
+#else
+ return 1;
+#endif
+}
+
+double
+DialogGetReconstructionParameters::getFilterParam ()
+{
+ wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
+ double dValue;
+ if (strCtrl.ToDouble (&dValue))
+ return (dValue);
+ else
+ return (m_dDefaultFilterParam);
+}
+
+const char*
+DialogGetReconstructionParameters::getFilterName ()
+{
+ return m_pRadioBoxFilter->getSelectionStringValue();
+}
+
+const char*
+DialogGetReconstructionParameters::getFilterMethodName ()
+{
+ return m_pRadioBoxFilterMethod->getSelectionStringValue();
+}
+
+const char*
+DialogGetReconstructionParameters::getInterpName ()
+{
+ return m_pRadioBoxInterp->getSelectionStringValue();
+}