** Date Started: July 2000
**
** This is part of the CTSim program
-** Copyright (C) 1983-2000 Kevin Rosenberg
+** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: dialogs.cpp,v 1.24 2001/01/02 16:02:13 kevin Exp $
+** $Id: dialogs.cpp,v 1.27 2001/01/28 19:10:18 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
};
const char*
-StringValueAndTitleListBox::getSelectionStringValue (void) const
+StringValueAndTitleListBox::getSelectionStringValue () const
{
return m_ppszValues[GetSelection()];
}
// DialogGetPhantom
///////////////////////////////////////////////////////////////////////
-DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom)
+DialogGetPhantom::DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom)
: wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
}
const char*
-DialogGetPhantom::getPhantom(void)
+DialogGetPhantom::getPhantom()
{
return m_pListBoxPhantom->getSelectionStringValue();
}
// DialogGetComparisonImage
///////////////////////////////////////////////////////////////////////
-DialogGetComparisonImage::DialogGetComparisonImage (wxFrame* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)
+DialogGetComparisonImage::DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)
: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rVecIF(rVecIF)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
}
ImageFileDocument*
-DialogGetComparisonImage::getImageFileDocument(void)
+DialogGetComparisonImage::getImageFileDocument()
{
return m_rVecIF[ m_pListBoxImageChoices->GetSelection() ];
}
// CLASS DiaglogGetMinMax Implementation
/////////////////////////////////////////////////////////////////////
-DialogGetMinMax::DialogGetMinMax (wxFrame* pParent, const char* const pszTitle, double dDefaultMin, double dDefaultMax)
+DialogGetMinMax::DialogGetMinMax (wxWindow* pParent, const char* const pszTitle, double dDefaultMin, double dDefaultMax)
: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
pTopSizer->SetSizeHints (this);
}
-DialogGetMinMax::~DialogGetMinMax (void)
+DialogGetMinMax::~DialogGetMinMax ()
{
}
double
-DialogGetMinMax::getMinimum (void)
+DialogGetMinMax::getMinimum ()
{
wxString strCtrl = m_pTextCtrlMin->GetValue();
double dValue;
}
double
-DialogGetMinMax::getMaximum (void)
+DialogGetMinMax::getMaximum ()
{
wxString strCtrl = m_pTextCtrlMax->GetValue();
double dValue;
// CLASS DialogAutoScaleParameters IMPLEMENTATION
/////////////////////////////////////////////////////////////////////
-DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor)
+DialogAutoScaleParameters::DialogAutoScaleParameters (wxWindow *pParent, double mean, double mode, double median, double stddev, double dDefaultScaleFactor)
: wxDialog (pParent, -1, "Auto Scale Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_dMean(mean), m_dMode(mode), m_dMedian(median), m_dStdDev(stddev)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
// DialogGetRasterParameters
/////////////////////////////////////////////////////////////////////
-DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples)
+DialogGetRasterParameters::DialogGetRasterParameters (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples)
: wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
pTopSizer->SetSizeHints (this);
}
-DialogGetRasterParameters::~DialogGetRasterParameters (void)
+DialogGetRasterParameters::~DialogGetRasterParameters ()
{
}
unsigned int
-DialogGetRasterParameters::getXSize (void)
+DialogGetRasterParameters::getXSize ()
{
wxString strCtrl = m_pTextCtrlXSize->GetValue();
unsigned long lValue;
}
unsigned int
-DialogGetRasterParameters::getYSize (void)
+DialogGetRasterParameters::getYSize ()
{
wxString strCtrl = m_pTextCtrlYSize->GetValue();
unsigned long lValue;
unsigned int
-DialogGetRasterParameters::getNSamples (void)
+DialogGetRasterParameters::getNSamples ()
{
wxString strCtrl = m_pTextCtrlNSamples->GetValue();
unsigned long lValue;
/////////////////////////////////////////////////////////////////////
-DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet, int iDefaultNView, int iDefaultNSamples, double dDefaultRotAngle, double dDefaultFocalLength, double dDefaultFieldOfView, int iDefaultGeometry, int iDefaultTrace)
+DialogGetProjectionParameters::DialogGetProjectionParameters (wxWindow* 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)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
pTopSizer->SetSizeHints (this);
}
-DialogGetProjectionParameters::~DialogGetProjectionParameters (void)
+DialogGetProjectionParameters::~DialogGetProjectionParameters ()
{
}
unsigned int
-DialogGetProjectionParameters::getNDet (void)
+DialogGetProjectionParameters::getNDet ()
{
wxString strCtrl = m_pTextCtrlNDet->GetValue();
unsigned long lValue;
}
unsigned int
-DialogGetProjectionParameters::getNView (void)
+DialogGetProjectionParameters::getNView ()
{
wxString strCtrl = m_pTextCtrlNView->GetValue();
unsigned long lValue;
unsigned int
-DialogGetProjectionParameters::getNSamples (void)
+DialogGetProjectionParameters::getNSamples ()
{
wxString strCtrl = m_pTextCtrlNSamples->GetValue();
unsigned long lValue;
}
double
-DialogGetProjectionParameters::getRotAngle (void)
+DialogGetProjectionParameters::getRotAngle ()
{
wxString strCtrl = m_pTextCtrlRotAngle->GetValue();
double dValue;
}
double
-DialogGetProjectionParameters::getFocalLengthRatio (void)
+DialogGetProjectionParameters::getFocalLengthRatio ()
{
wxString strCtrl = m_pTextCtrlFocalLength->GetValue();
double dValue;
}
double
-DialogGetProjectionParameters::getFieldOfViewRatio (void)
+DialogGetProjectionParameters::getFieldOfViewRatio ()
{
wxString strCtrl = m_pTextCtrlFieldOfView->GetValue();
double dValue;
}
const char*
-DialogGetProjectionParameters::getGeometry (void)
+DialogGetProjectionParameters::getGeometry ()
{
return m_pListBoxGeometry->getSelectionStringValue();
}
int
-DialogGetProjectionParameters::getTrace (void)
+DialogGetProjectionParameters::getTrace ()
{
return Trace::convertTraceNameToID(m_pListBoxTrace->getSelectionStringValue());
}
/////////////////////////////////////////////////////////////////////
-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)
+DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxWindow* 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)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
pTopSizer->SetSizeHints (this);
}
-DialogGetReconstructionParameters::~DialogGetReconstructionParameters (void)
+DialogGetReconstructionParameters::~DialogGetReconstructionParameters ()
{
}
unsigned int
-DialogGetReconstructionParameters::getXSize (void)
+DialogGetReconstructionParameters::getXSize ()
{
wxString strCtrl = m_pTextCtrlXSize->GetValue();
unsigned long lValue;
}
unsigned int
-DialogGetReconstructionParameters::getYSize (void)
+DialogGetReconstructionParameters::getYSize ()
{
wxString strCtrl = m_pTextCtrlYSize->GetValue();
unsigned long lValue;
}
unsigned int
-DialogGetReconstructionParameters::getZeropad (void)
+DialogGetReconstructionParameters::getZeropad ()
{
wxString strCtrl = m_pTextCtrlZeropad->GetValue();
unsigned long lValue;
unsigned int
-DialogGetReconstructionParameters::getInterpParam (void)
+DialogGetReconstructionParameters::getInterpParam ()
{
wxString strCtrl = m_pTextCtrlInterpParam->GetValue();
unsigned long lValue;
}
double
-DialogGetReconstructionParameters::getFilterParam (void)
+DialogGetReconstructionParameters::getFilterParam ()
{
wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
double dValue;
}
const char*
-DialogGetReconstructionParameters::getFilterName (void)
+DialogGetReconstructionParameters::getFilterName ()
{
return m_pListBoxFilter->getSelectionStringValue();
}
const char*
-DialogGetReconstructionParameters::getFilterMethodName (void)
+DialogGetReconstructionParameters::getFilterMethodName ()
{
return m_pListBoxFilterMethod->getSelectionStringValue();
}
const char*
-DialogGetReconstructionParameters::getInterpName (void)
+DialogGetReconstructionParameters::getInterpName ()
{
return m_pListBoxInterp->getSelectionStringValue();
}
int
-DialogGetReconstructionParameters::getTrace (void)
+DialogGetReconstructionParameters::getTrace ()
{
int iTrace = 0;
if (strcmp("full", m_pListBoxTrace->getSelectionStringValue()) == 0)
}
const char*
-DialogGetReconstructionParameters::getBackprojectName (void)
+DialogGetReconstructionParameters::getBackprojectName ()
{
return m_pListBoxBackproject->getSelectionStringValue();
}
const char*
-DialogGetReconstructionParameters::getFilterGenerationName (void)
+DialogGetReconstructionParameters::getFilterGenerationName ()
{
return m_pListBoxFilterGeneration->getSelectionStringValue();
}
/////////////////////////////////////////////////////////////////////
-DialogGetFilterParameters::DialogGetFilterParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam, double dDefaultBandwidth, int iDefaultDomainID, double dDefaultInputScale, double dDefaultOutputScale)
+
+DialogGetFilterParameters::DialogGetFilterParameters (wxWindow* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultFilterID, double dDefaultFilterParam, double dDefaultBandwidth, int iDefaultDomainID, double dDefaultInputScale, double dDefaultOutputScale)
: wxDialog (pParent, -1, "Set Filter Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
pTopSizer->SetSizeHints (this);
}
-DialogGetFilterParameters::~DialogGetFilterParameters (void)
+DialogGetFilterParameters::~DialogGetFilterParameters ()
{
}
unsigned int
-DialogGetFilterParameters::getXSize (void)
+DialogGetFilterParameters::getXSize ()
{
wxString strCtrl = m_pTextCtrlXSize->GetValue();
unsigned long lValue;
}
unsigned int
-DialogGetFilterParameters::getYSize (void)
+DialogGetFilterParameters::getYSize ()
{
wxString strCtrl = m_pTextCtrlYSize->GetValue();
unsigned long lValue;
}
double
-DialogGetFilterParameters::getBandwidth (void)
+DialogGetFilterParameters::getBandwidth ()
{
wxString strCtrl = m_pTextCtrlBandwidth->GetValue();
double dValue;
}
double
-DialogGetFilterParameters::getFilterParam (void)
+DialogGetFilterParameters::getFilterParam ()
{
wxString strCtrl = m_pTextCtrlFilterParam->GetValue();
double dValue;
}
double
-DialogGetFilterParameters::getInputScale (void)
+DialogGetFilterParameters::getInputScale ()
{
wxString strCtrl = m_pTextCtrlInputScale->GetValue();
double dValue;
}
double
-DialogGetFilterParameters::getOutputScale (void)
+DialogGetFilterParameters::getOutputScale ()
{
wxString strCtrl = m_pTextCtrlOutputScale->GetValue();
double dValue;
}
const char*
-DialogGetFilterParameters::getFilterName (void)
+DialogGetFilterParameters::getFilterName ()
{
return m_pListBoxFilter->getSelectionStringValue();
}
const char*
-DialogGetFilterParameters::getDomainName (void)
+DialogGetFilterParameters::getDomainName ()
{
return m_pListBoxDomain->getSelectionStringValue();
}
// DialogExportParameters
///////////////////////////////////////////////////////////////////////
-DialogExportParameters::DialogExportParameters (wxFrame* pParent, int iDefaultFormatID)
+DialogExportParameters::DialogExportParameters (wxWindow* pParent, int iDefaultFormatID)
: wxDialog (pParent, -1, "Select ExportParameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
}
const char*
-DialogExportParameters::getFormatName(void)
+DialogExportParameters::getFormatName()
{
return m_pListBoxFormat->getSelectionStringValue();
}
// CLASS DiaglogGetXYSize Implementation
/////////////////////////////////////////////////////////////////////
-DialogGetXYSize::DialogGetXYSize (wxFrame* pParent, const char* const pszTitle, int iDefaultXSize, int iDefaultYSize)
+DialogGetXYSize::DialogGetXYSize (wxWindow* pParent, const char* const pszTitle, int iDefaultXSize, int iDefaultYSize)
: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
m_iDefaultXSize = iDefaultXSize;
pTopSizer->SetSizeHints (this);
}
-DialogGetXYSize::~DialogGetXYSize (void)
+DialogGetXYSize::~DialogGetXYSize ()
{
}
unsigned int
-DialogGetXYSize::getXSize (void)
+DialogGetXYSize::getXSize ()
{
wxString strCtrl = m_pTextCtrlXSize->GetValue();
long lValue;
}
unsigned int
-DialogGetXYSize::getYSize (void)
+DialogGetXYSize::getYSize ()
{
wxString strCtrl = m_pTextCtrlYSize->GetValue();
long lValue;
return (m_iDefaultYSize);
}
+
+
+/////////////////////////////////////////////////////////////////////
+// CLASS IDENTIFICATION
+//
+// DialogGetConvertPolarParameters
+/////////////////////////////////////////////////////////////////////
+
+DialogGetConvertPolarParameters::DialogGetConvertPolarParameters (wxWindow* pParent, const char* const pszTitle,
+ int iDefaultXSize, int iDefaultYSize, int iDefaultInterpolationID, int iDefaultZeropad)
+: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ m_iDefaultXSize = iDefaultXSize;
+ m_iDefaultYSize = iDefaultYSize;
+ m_iDefaultZeropad = iDefaultZeropad;
+
+ 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 << iDefaultXSize;
+ m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ std::ostringstream osYSize;
+ osYSize << iDefaultYSize;
+ m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+
+ wxFlexGridSizer* pGridSizer = new wxFlexGridSizer (2);
+
+ m_pListBoxInterpolation = new StringValueAndTitleListBox (this, Projections::getInterpCount(), Projections::getInterpTitleArray(), Projections::getInterpNameArray());
+ m_pListBoxInterpolation->SetSelection (iDefaultInterpolationID);
+ pGridSizer->Add (new wxStaticText (this, -1, "Interpolation"), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
+ pGridSizer->Add (m_pListBoxInterpolation, 0, wxALL | wxALIGN_LEFT | wxEXPAND);
+
+ 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);
+ pGridSizer->Add (m_pTextCtrlYSize, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ if (iDefaultZeropad >= 0) {
+ std::ostringstream osZeropad;
+ osZeropad << iDefaultZeropad;
+ m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0);
+ pGridSizer->Add (new wxStaticText (this, -1, "Zeropad"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pTextCtrlZeropad, 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();
+ pTopSizer->Fit (this);
+ pTopSizer->SetSizeHints (this);
+}
+
+
+DialogGetConvertPolarParameters::~DialogGetConvertPolarParameters ()
+{
+}
+
+
+unsigned int
+DialogGetConvertPolarParameters::getXSize ()
+{
+ wxString strCtrl = m_pTextCtrlXSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultXSize);
+}
+
+unsigned int
+DialogGetConvertPolarParameters::getYSize ()
+{
+ wxString strCtrl = m_pTextCtrlYSize->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultYSize);
+}
+
+unsigned int
+DialogGetConvertPolarParameters::getZeropad ()
+{
+ wxString strCtrl = m_pTextCtrlZeropad->GetValue();
+ unsigned long lValue;
+ if (strCtrl.ToULong (&lValue))
+ return lValue;
+ else
+ return (m_iDefaultZeropad);
+}
+
+const char*
+DialogGetConvertPolarParameters::getInterpolationName ()
+{
+ return m_pListBoxInterpolation->getSelectionStringValue();
+}
+