X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fdialogs.cpp;h=4125f10f076fa2080008565e32513f14c36e1a7f;hb=9ff5b5165b2c8871bd4b29ccd5ca794638414615;hp=b4811ed1faeb74aff28170b42c981a63f9df90e4;hpb=de411914da8b157958e9caae917bf1edeafbb713;p=ctsim.git diff --git a/src/dialogs.cpp b/src/dialogs.cpp index b4811ed..4125f10 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -9,7 +9,7 @@ ** 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 @@ -47,6 +47,7 @@ #include "docs.h" #include "views.h" #include "imagefile.h" +#include "projections.h" #if defined(MSVC) || HAVE_SSTREAM #include @@ -142,6 +143,64 @@ DialogGetPhantom::getPhantom() } +/////////////////////////////////////////////////////////////////////// +// 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 @@ -392,7 +451,7 @@ DialogAutoScaleParameters::DialogAutoScaleParameters (wxWindow *pParent, double 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); @@ -429,11 +488,11 @@ bool 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;