r187: *** empty log message ***
[ctsim.git] / src / dialogs.h
index 159294727122dc01326171551b7145d628f81e1d..1cd86e3efb879e37eba1d520ce5d804cfd404437 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: dialogs.h,v 1.5 2000/07/20 11:17:31 kevin Exp $
+**  $Id: dialogs.h,v 1.13 2000/09/02 05:10:39 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 "wx/wx.h"
 #include <string>
+#include "ctsupport.h"
+#include "scanner.h"
+#include "phantom.h"
+#include "procsignal.h"
+#include "filter.h"
+
+// CLASS StringValueAndTitleListBox
+//
+// A superclass of wxListBox that can handle string values and titles
+// and by displaying the title in the list box and returning the string value
+
+class StringValueAndTitleListBox : public wxListBox
+{
+ public:
+  StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
+
+    const char* getSelectionStringValue () const;
+
+ private:
+    const char** m_ppszValues;
+};
 
 
 class DialogGetPhantom : public wxDialog
 {
  public:
-    DialogGetPhantom (wxFrame* pParent, const char* szDefaultPhantom);
-    virtual ~DialogGetPhantom (void) {}
+    DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN);
+    virtual ~DialogGetPhantom () {}
 
-    const wxString& getPhantom (void);
+    const char* getPhantom ();
 
  private:
-    wxListBox* m_pListBoxPhantom;
-    wxString m_sDefaultPhantom;
-
-    static const wxString s_asPhantom[];
-    static const wxString s_asPhantomTitle[];
-    static const unsigned int s_iNumPhantom;
+    StringValueAndTitleListBox* m_pListBoxPhantom;
 };
 
 
@@ -56,10 +72,10 @@ class DialogGetImageMinMax : public wxDialog
 {
  public:
     DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin = 0., double dDefaultMax = 0.);
-    virtual ~DialogGetImageMinMax (void);
+    virtual ~DialogGetImageMinMax ();
 
-    double getMinimum (void);
-    double getMaximum (void);
+    double getMinimum ();
+    double getMaximum ();
 
  private:
     wxTextCtrl* m_pTextCtrlMin;
@@ -74,11 +90,11 @@ class DialogGetRasterParameters : public wxDialog
 {
  public:
     DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1);
-    virtual ~DialogGetRasterParameters (void);
+    virtual ~DialogGetRasterParameters ();
 
-    unsigned int getXSize (void);
-    unsigned int getYSize (void);
-    unsigned int getNSamples (void);
+    unsigned int getXSize ();
+    unsigned int getYSize ();
+    unsigned int getNSamples ();
 
  private:
     wxTextCtrl* m_pTextCtrlXSize;
@@ -94,49 +110,59 @@ class DialogGetRasterParameters : public wxDialog
 class DialogGetProjectionParameters : public wxDialog
 {
  public:
-    DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet = 0, int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1., const char* szDefaultGeometry = NULL);
-    ~DialogGetProjectionParameters (void);
+    DialogGetProjectionParameters (wxFrame* pParent, int iDefaultNDet = 0, int iDefaultNView = 0, int iDefaultNSamples = 1, double dDefaultRotAngle = 1., double dDefaultFocalLength = 1, double dDefaultFieldOfView = 1., int iDefaultGeometry = Scanner::GEOMETRY_PARALLEL, int iDefaultTrace = Trace::TRACE_NONE);
+    ~DialogGetProjectionParameters ();
 
-    unsigned int getNDet (void);
-    unsigned int getNView (void);
-    unsigned int getNSamples (void);
-    double getRotAngle (void);
-    const wxString& getGeometry(void);
+    unsigned int getNDet ();
+    unsigned int getNView ();
+    unsigned int getNSamples ();
+    int getTrace ();
+
+    double getRotAngle ();
+    double getFieldOfViewRatio ();
+    double getFocalLengthRatio ();
+    const char* getGeometry();
 
  private:
     wxTextCtrl* m_pTextCtrlNDet;
     wxTextCtrl* m_pTextCtrlNView;
     wxTextCtrl* m_pTextCtrlNSamples;
     wxTextCtrl* m_pTextCtrlRotAngle;
-    wxListBox* m_pListBoxGeometry;
+    wxTextCtrl* m_pTextCtrlFocalLength;
+    wxTextCtrl* m_pTextCtrlFieldOfView;
+
+    StringValueAndTitleListBox* m_pListBoxGeometry;
+    StringValueAndTitleListBox* m_pListBoxTrace;
 
     int m_iDefaultNDet;
     int m_iDefaultNView;
     int m_iDefaultNSamples;
+    int m_iDefaultTrace;
+    int m_iDefaultGeometry;
     double m_dDefaultRotAngle;
-    wxString m_sDefaultGeometry;
-
-    static const wxString s_asGeometry[];
-    static const wxString s_asGeometryTitle[];
-    static const unsigned int s_iNumGeometry;
+    double m_dDefaultFocalLength;
+    double m_dDefaultFieldOfView;
 };
 
 
+#include "backprojectors.h"
 class DialogGetReconstructionParameters : public wxDialog
 {
  public:
-    DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, const char* szDefaultFilterName = NULL, double dDefaultFilterParam = 1., const char* szDefaultFilterMethodName = NULL, int iDefaultZeropad = 3, const char* szDefaultInterpName = NULL, int iDefaultInterpParam = 1, const char* szDefaultBackprojName = NULL);
-    virtual ~DialogGetReconstructionParameters (void);
-
-    unsigned int getXSize(void);
-    unsigned int getYSize(void);
-    const wxString& getFilterName(void);
-    double getFilterParam(void);
-    const wxString& getFilterMethodName(void);
-    unsigned int getZeropad(void);
-    const wxString& getInterpName(void);
-    unsigned int getInterpParam(void);
-    const wxString& getBackprojName(void);
+    DialogGetReconstructionParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultFilterID = SignalFilter::FILTER_ABS_BANDLIMIT, double dDefaultFilterParam = 1., int iDefaultFilterMethodID = ProcessSignal::FILTER_METHOD_CONVOLUTION, int iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_INVALID, int iDefaultZeropad = 3, int iDefaultInterpID = Backprojector::INTERP_LINEAR, int iDefaultInterpParam = 1, int iDefaultBackprojectID = Backprojector::BPROJ_IDIFF3, int iDefaultTrace = Trace::TRACE_NONE);
+    virtual ~DialogGetReconstructionParameters ();
+
+    unsigned int getXSize();
+    unsigned int getYSize();
+    const char* getFilterName();
+    double getFilterParam();
+    const char* getFilterMethodName();
+    unsigned int getZeropad();
+    const char* getFilterGenerationName();
+    const char* getInterpName();
+    unsigned int getInterpParam();
+    const char* getBackprojectName();
+    int getTrace ();
 
  private:
     wxTextCtrl* m_pTextCtrlXSize;
@@ -145,36 +171,35 @@ class DialogGetReconstructionParameters : public wxDialog
     wxTextCtrl* m_pTextCtrlFilterParam;
     wxTextCtrl* m_pTextCtrlInterpParam;
 
-    wxListBox* m_pListBoxFilter;
-    wxListBox* m_pListBoxFilterMethod;
-    wxListBox* m_pListBoxInterp;
-    wxListBox* m_pListBoxBackproj;
+    StringValueAndTitleListBox* m_pListBoxFilter;
+    StringValueAndTitleListBox* m_pListBoxFilterMethod;
+    StringValueAndTitleListBox* m_pListBoxFilterGeneration;
+    StringValueAndTitleListBox* m_pListBoxInterp;
+    StringValueAndTitleListBox* m_pListBoxBackproject;
+    StringValueAndTitleListBox* m_pListBoxTrace;
 
     int m_iDefaultXSize;
     int m_iDefaultYSize;
     double m_dDefaultFilterParam;
     int m_iDefaultZeropad;
     int m_iDefaultInterpParam;
-    wxString m_sDefaultFilterName;
-    wxString m_sDefaultFilterMethodName;
-    wxString m_sDefaultInterpName;
-    wxString m_sDefaultBackprojName;
-
-    static const wxString s_asFilter[];
-    static const wxString s_asFilterTitle[];
-    static const unsigned int s_iNumFilter;
-
-    static const wxString s_asFilterMethod[];
-    static const wxString s_asFilterMethodTitle[];
-    static const unsigned int s_iNumFilterMethod;
-
-    static const wxString s_asInterp[];
-    static const wxString s_asInterpTitle[];
-    static const unsigned int s_iNumInterp;
-
-    static const wxString s_asBackproj[];
-    static const wxString s_asBackprojTitle[];
-    static const unsigned int s_iNumBackproj;
+    int m_iDefaultTrace;
+};
+
+class DialogAutoScaleParameters : public wxDialog
+{
+ public:
+    DialogAutoScaleParameters (wxFrame* pParent, const ImageFile& rImageFile, double dDefaultScaleFactor = 1.);
+    virtual ~DialogAutoScaleParameters() {}
+
+    void getMinMax (double* pMin, double* pMax);
+    double getAutoScaleFactor ();
+
+ private:
+    const ImageFile& m_rImageFile;
+
+    wxTextCtrl* m_pTextCtrlStdDevFactor;
+    wxListBox* m_pListBoxCenter;
 };
 
 #endif