** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: dialogs.cpp,v 1.50 2001/03/11 15:27:30 kevin Exp $
+** $Id: dialogs.cpp,v 1.52 2001/03/13 04:44:25 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
#include "docs.h"
#include "views.h"
#include "imagefile.h"
+#include "projections.h"
#if defined(MSVC) || HAVE_SSTREAM
#include <sstream>
}
+///////////////////////////////////////////////////////////////////////
+// CLASS IMPLEMENTATION
+// DialogGetThetaRange
+///////////////////////////////////////////////////////////////////////
+
+DialogGetThetaRange::DialogGetThetaRange (wxWindow* pParent, int iDefaultThetaRange)
+: wxDialog (pParent, -1, _T("Select Phantom"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ pTopSizer->Add (new wxStaticText (this, -1, "Select Theta Range"), 0, wxCENTER | wxALL, 5);
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+
+ wxString asTitle[] = {"Unconstrained", "Normalized to 2pi", "Fold to pi"};
+
+ m_pRadioBoxThetaRange = new wxRadioBox (this, -1, _T("Theta Range"), wxDefaultPosition, wxDefaultSize, 3, asTitle, 1, wxRA_SPECIFY_COLS);
+ if (iDefaultThetaRange == ParallelRaysums::THETA_RANGE_UNCONSTRAINED)
+ m_pRadioBoxThetaRange->SetSelection (0);
+ else if (iDefaultThetaRange == ParallelRaysums::THETA_RANGE_NORMALIZE_TO_TWOPI)
+ m_pRadioBoxThetaRange->SetSelection (1);
+ else if (iDefaultThetaRange == ParallelRaysums::THETA_RANGE_FOLD_TO_PI)
+ m_pRadioBoxThetaRange->SetSelection (2);
+
+ pTopSizer->Add (m_pRadioBoxThetaRange, 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, "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_THETA_RANGE);
+ 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);
+}
+
+int
+DialogGetThetaRange::getThetaRange()
+{
+ int iSelection = m_pRadioBoxThetaRange->GetSelection();
+ if (iSelection == 0)
+ return ParallelRaysums::THETA_RANGE_UNCONSTRAINED;
+ else if (iSelection == 1)
+ return ParallelRaysums::THETA_RANGE_NORMALIZE_TO_TWOPI;
+ else
+ return ParallelRaysums::THETA_RANGE_FOLD_TO_PI;
+}
+
+
///////////////////////////////////////////////////////////////////////
// CLASS IMPLEMENTATION
// DialogGetComparisonImage
pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
- wxString asTitle[] = {"Median", "Mode", "Mean"};
+ 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);
DialogAutoScaleParameters::getMinMax (double* pMin, double* pMax)
{
int iCenter = m_pRadioBoxCenter->GetSelection();
- double dCenter = m_dMedian;
+ double dCenter = m_dMode;
if (iCenter == 1)
- dCenter = m_dMode;
+ dCenter = m_dMedian;
else if (iCenter == 2)
- dCenter = m_dMode;
+ dCenter = m_dMean;
wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
double dValue;