]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/marParameters.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / marParameters.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 /*=========================================================================
27
28   Program:   wxMaracas
29   Module:    $RCSfile: marParameters.h,v $
30   Language:  C++
31   Date:      $Date: 2012/11/15 14:16:12 $
32   Version:   $Revision: 1.5 $
33
34   Copyright: (c) 2002, 2003
35   License:
36   
37      This software is distributed WITHOUT ANY WARRANTY; without even 
38      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
39      PURPOSE.  See the above copyright notice for more information.
40
41 =========================================================================*/
42 #ifndef __MAR__KERNEL__PARAMETERS__HXX__
43 #define __MAR__KERNEL__PARAMETERS__HXX__
44
45 #include "marTypes.h"
46 #include <wx/arrstr.h>
47 #include <wx/list.h>
48 #include <fstream>
49 //using namespace std;
50
51 /** /def marParameters
52  *  \brief Parameters class definition.
53  */
54 class creaMaracasVisu_EXPORT marParameters
55 {
56     public:
57
58     /** /def Enumerations
59      *  Some mnemonic enumerations for indexes or
60      *  behaviour types.
61      */
62     enum VoxelTypes
63     {
64             VOX_TYPE_MINIMUM = 0x01,
65             VOX_TYPE_NORMAL  = 0x02
66
67     };
68     enum AlgorithmTypes
69     {
70             ISOCONTOURS = 1,
71             SNAKE       = 2,
72             DERICHE     = 3
73
74     };
75     enum QuantificationTypes
76     {
77             TYPE_AREA                    = 0x01,
78             TYPE_PERIMETER               = 0x02,
79             TYPE_DIAMETER_FROM_AREA      = 0x04,
80             TYPE_DIAMETER_FROM_PERIMETER = 0x08,
81             TYPE_MINIMUM_DIAMETER        = 0x10,
82             TYPE_MAXIMUM_DIAMETER        = 0x20,
83             TYPE_AVERAGE_DIAMETER        = 0x40
84
85     };
86     enum BoolParamIndexes
87     {
88 // PS ->            e_debug_window_visible = 0  ,
89 // PS ->            e_debug_console_visible     ,
90 // PS ->            e_calculate_mip_default     ,
91 // PS ->            e_choose_all_slices_default ,
92             e_debug_isocontour          ,
93             e_debug_diameters           ,
94             e_debug_fill_area           ,
95             e_invest_slice_order        ,
96 // PS ->            e_show_cell                 ,
97 // PS ->            e_show_int_cell             ,
98                 e_bool_cont
99     };
100     enum DoubleParamIndexes
101     {
102             e_gravity_distance = 0          ,
103             e_axis_discret_step             ,
104             e_distance_to_maximum_intensity ,
105             e_cell_coeficient               ,
106             e_flexion_coeficient            ,
107             e_tension_coeficient            ,
108             e_voxel_x_dimension             ,
109             e_voxel_y_dimension             ,
110             e_voxel_z_dimension             ,
111             e_scale                         ,
112 // PS ->            e_sampling                      ,
113             e_threshold_isocontour          ,
114             e_threshold_snake_isocontour    ,
115             e_sigma                         ,
116         e_RescaleIntercept              ,
117         e_RescaleSlope                  ,
118 // PS ->            e_gradient_coeficient           ,
119 // PS ->            e_extern_coeficient             ,
120 // PS ->            e_ballon_coeficient             ,
121 // PS ->            e_back_color_3D_r               ,
122 // PS ->            e_back_color_3D_g               ,
123 // PS ->            e_back_color_3D_b               ,
124 // PS ->            e_axis_color_r                  ,
125 // PS ->            e_axis_color_g                  ,
126 // PS ->            e_axis_color_b                  ,
127             e_double_cont
128     };
129     enum IntParamIndexes
130     {
131             e_roi_dimension = 0                     ,
132             e_step                                  ,
133             e_step_coeficient                       ,
134             e_mass_power                            ,
135             e_algorithm_type                        ,
136             e_mask_size                             ,
137             e_number_of_points_for_snake            ,
138             e_quantification_type                   ,
139             e_stenosis_type                         ,
140 // PS ->            e_number_of_iterations_snake_isocontour ,
141 // PS ->            e_number_of_iterations_snake_deriche    ,
142             e_voxel_type                            ,
143 // PS ->            e_coef_cell_max_int                     ,
144             e_int_cont
145     };
146
147 //EED
148         enum StringParamIndexes
149      {
150             e_installation_directory = 0 ,
151             e_dicom_images_directory    ,
152             e_string_cont
153      };
154
155     public:
156
157     /** Default constructor.
158      */
159     marParameters( ) { reset( );  };
160
161     /** Default destructor.
162      */
163     ~marParameters( ) {}
164
165     /** Default analyzers & modificators.
166      *
167      *  These methods use an index i, which should be one defined on
168      *  correspondant type enum. For example, if you want to get the
169      *  installation directory parameter you should write:
170      *
171      *  marParameters* myParams = new marParameters( );
172      *  std::string myDir = myParams->
173      *                         getStringParam(
174      *                              marParameters::e_installation_directory );
175      */
176     bool   getBoolParam( int i )            { return( _boolValues[ i ] );   };
177     double getDoubleParam( int i )          { return( _doubleValues[ i ] ); };
178     int    getIntParam( int i )             { return( _intValues[ i ] );    };
179
180 //EED
181      wxString& getStringParam( int i )       { return( _stringValues[ i ] );};
182
183     void   setBoolParam( int i, bool p )     { _boolValues[ i ] = p;        };
184     void   setDoubleParam( int i, double p ) { _doubleValues[ i ] = p;      };
185     void   setIntParam( int i, int p )       { _intValues[ i ] = p;         };
186
187 //EED
188      void setStringParam( int i, const wxString& p ) { _stringValues[ i ] = p;  };
189
190     /** Special analizers & modifiers
191      *  (in marKernel context, of course).
192      */
193     double      getVoxelSize( );
194     double      getDimIma( );
195     int         getSizeIma( );
196     double      getImaRatio( );
197     float       getRescaleSlope();
198     float       getRescaleIntercept();
199         bool    getInvestSliceOrder();
200
201     void        setROIStep( double width );
202     void        setRescaleSlope(float slope);
203     void        setRescaleIntercept(float intercept);
204
205
206     /** Copy.
207      */
208     void   copyFrom( const marParameters& from );
209
210     /** Persistence methods.
211      */
212     void reset( );
213     bool save( std::ofstream& os );
214     bool load( std::ifstream& is );
215     bool save( wxString& nw );
216     bool load( wxString& nr );
217
218     wxArrayString getRelationalArray( );
219     void setRelationalArray( wxArrayString& arr );
220
221         //MAZV - Added for CT compatibility
222         int getContourThresh();
223         double getStandardDeviation();
224         double getRadius();
225         int     getLumenPercentage();
226         int getCalcPercentage();
227
228         void setContourThresh( int thresh );
229         void setStandardDeviation( double dev );
230         void setRadius( double rad );
231         void setLumenPercentage(int percentage);
232         void setCalcPercentage(int percentage);
233         //MAZV - End of addition
234
235
236   private:
237
238     bool   _boolValues[ ( int )e_bool_cont ];
239     double _doubleValues[ ( int )e_double_cont ];
240     int   _intValues[ ( int )e_int_cont ];
241
242 // EED
243         wxString _stringValues[ ( int )e_string_cont ];
244
245         //MAZV Added fot CT compatibility
246         int     _contourThresh;
247         double  _standardDeviation;
248         double  _radius;
249         int _lumenPercentage;
250         int _calcPercentage;
251         //MAZV - End of addition
252
253 };
254
255
256         
257         
258
259 #endif // __MAR__KERNEL__PARAMETERS__HXX__
260
261 // eof - marParameters.h