]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/marParameters.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / marParameters.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: marParameters.h,v $
5   Language:  C++
6   Date:      $Date: 2008/11/24 10:47:12 $
7   Version:   $Revision: 1.2 $
8
9   Copyright: (c) 2002, 2003
10   License:
11   
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notice for more information.
15
16 =========================================================================*/
17 #ifndef __MAR__KERNEL__PARAMETERS__HXX__
18 #define __MAR__KERNEL__PARAMETERS__HXX__
19
20 #include "marTypes.h"
21 #include <wx/arrstr.h>
22 #include <wx/list.h>
23 #include <fstream>
24 //using namespace std;
25
26 /** /def marParameters
27  *  \brief Parameters class definition.
28  */
29 class MARACASVISULIB_EXPORTS marParameters
30 {
31     public:
32
33     /** /def Enumerations
34      *  Some mnemonic enumerations for indexes or
35      *  behaviour types.
36      */
37     enum VoxelTypes
38     {
39             VOX_TYPE_MINIMUM = 0x01,
40             VOX_TYPE_NORMAL  = 0x02
41
42     };
43     enum AlgorithmTypes
44     {
45             ISOCONTOURS = 1,
46             SNAKE       = 2,
47             DERICHE     = 3
48
49     };
50     enum QuantificationTypes
51     {
52             TYPE_AREA                    = 0x01,
53             TYPE_PERIMETER               = 0x02,
54             TYPE_DIAMETER_FROM_AREA      = 0x04,
55             TYPE_DIAMETER_FROM_PERIMETER = 0x08,
56             TYPE_MINIMUM_DIAMETER        = 0x10,
57             TYPE_MAXIMUM_DIAMETER        = 0x20,
58             TYPE_AVERAGE_DIAMETER        = 0x40
59
60     };
61     enum BoolParamIndexes
62     {
63 // PS ->            e_debug_window_visible = 0  ,
64 // PS ->            e_debug_console_visible     ,
65 // PS ->            e_calculate_mip_default     ,
66 // PS ->            e_choose_all_slices_default ,
67             e_debug_isocontour          ,
68             e_debug_diameters           ,
69             e_debug_fill_area           ,
70             e_invest_slice_order        ,
71 // PS ->            e_show_cell                 ,
72 // PS ->            e_show_int_cell             ,
73                 e_bool_cont
74     };
75     enum DoubleParamIndexes
76     {
77             e_gravity_distance = 0          ,
78             e_axis_discret_step             ,
79             e_distance_to_maximum_intensity ,
80             e_cell_coeficient               ,
81             e_flexion_coeficient            ,
82             e_tension_coeficient            ,
83             e_voxel_x_dimension             ,
84             e_voxel_y_dimension             ,
85             e_voxel_z_dimension             ,
86             e_scale                         ,
87 // PS ->            e_sampling                      ,
88             e_threshold_isocontour          ,
89             e_threshold_snake_isocontour    ,
90             e_sigma                         ,
91         e_RescaleIntercept              ,
92         e_RescaleSlope                  ,
93 // PS ->            e_gradient_coeficient           ,
94 // PS ->            e_extern_coeficient             ,
95 // PS ->            e_ballon_coeficient             ,
96 // PS ->            e_back_color_3D_r               ,
97 // PS ->            e_back_color_3D_g               ,
98 // PS ->            e_back_color_3D_b               ,
99 // PS ->            e_axis_color_r                  ,
100 // PS ->            e_axis_color_g                  ,
101 // PS ->            e_axis_color_b                  ,
102             e_double_cont
103     };
104     enum IntParamIndexes
105     {
106             e_roi_dimension = 0                     ,
107             e_step                                  ,
108             e_step_coeficient                       ,
109             e_mass_power                            ,
110             e_algorithm_type                        ,
111             e_mask_size                             ,
112             e_number_of_points_for_snake            ,
113             e_quantification_type                   ,
114             e_stenosis_type                         ,
115 // PS ->            e_number_of_iterations_snake_isocontour ,
116 // PS ->            e_number_of_iterations_snake_deriche    ,
117             e_voxel_type                            ,
118 // PS ->            e_coef_cell_max_int                     ,
119             e_int_cont
120     };
121
122 //EED
123         enum StringParamIndexes
124      {
125             e_installation_directory = 0 ,
126             e_dicom_images_directory    ,
127             e_string_cont
128      };
129
130     public:
131
132     /** Default constructor.
133      */
134     marParameters( ) { reset( );  };
135
136     /** Default destructor.
137      */
138     ~marParameters( ) {}
139
140     /** Default analyzers & modificators.
141      *
142      *  These methods use an index i, which should be one defined on
143      *  correspondant type enum. For example, if you want to get the
144      *  installation directory parameter you should write:
145      *
146      *  marParameters* myParams = new marParameters( );
147      *  std::string myDir = myParams->
148      *                         getStringParam(
149      *                              marParameters::e_installation_directory );
150      */
151     bool   getBoolParam( int i )            { return( _boolValues[ i ] );   };
152     double getDoubleParam( int i )          { return( _doubleValues[ i ] ); };
153     int    getIntParam( int i )             { return( _intValues[ i ] );    };
154
155 //EED
156      wxString& getStringParam( int i )       { return( _stringValues[ i ] );};
157
158     void   setBoolParam( int i, bool p )     { _boolValues[ i ] = p;        };
159     void   setDoubleParam( int i, double p ) { _doubleValues[ i ] = p;      };
160     void   setIntParam( int i, int p )       { _intValues[ i ] = p;         };
161
162 //EED
163      void setStringParam( int i, const wxString& p ) { _stringValues[ i ] = p;  };
164
165     /** Special analizers & modifiers
166      *  (in marKernel context, of course).
167      */
168     double      getVoxelSize( );
169     double      getDimIma( );
170     int         getSizeIma( );
171     double      getImaRatio( );
172     float       getRescaleSlope();
173     float       getRescaleIntercept();
174         bool    getInvestSliceOrder();
175
176     void        setROIStep( double width );
177     void        setRescaleSlope(float slope);
178     void        setRescaleIntercept(float intercept);
179
180
181     /** Copy.
182      */
183     void   copyFrom( const marParameters& from );
184
185     /** Persistence methods.
186      */
187     void reset( );
188     bool save( std::ofstream& os );
189     bool load( std::ifstream& is );
190     bool save( wxString& nw );
191     bool load( wxString& nr );
192
193     wxArrayString getRelationalArray( );
194     void setRelationalArray( wxArrayString& arr );
195
196         //MAZV - Added for CT compatibility
197         int getContourThresh();
198         double getStandardDeviation();
199         double getRadius();
200         int     getLumenPercentage();
201         int getCalcPercentage();
202
203         void setContourThresh( int thresh );
204         void setStandardDeviation( double dev );
205         void setRadius( double rad );
206         void setLumenPercentage(int percentage);
207         void setCalcPercentage(int percentage);
208         //MAZV - End of addition
209
210
211   private:
212
213     bool   _boolValues[ ( int )e_bool_cont ];
214     double _doubleValues[ ( int )e_double_cont ];
215     int   _intValues[ ( int )e_int_cont ];
216
217 // EED
218         wxString _stringValues[ ( int )e_string_cont ];
219
220         //MAZV Added fot CT compatibility
221         int     _contourThresh;
222         double  _standardDeviation;
223         double  _radius;
224         int _lumenPercentage;
225         int _calcPercentage;
226         //MAZV - End of addition
227
228 };
229
230
231         
232         
233
234 #endif // __MAR__KERNEL__PARAMETERS__HXX__
235
236 // eof - marParameters.h