]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/include/marInterfaceCT.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / include / marInterfaceCT.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 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
29 #                        pour la Sant�)
30 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
31 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
32 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
33 #
34 #  This software is governed by the CeCILL-B license under French law and
35 #  abiding by the rules of distribution of free software. You can  use,
36 #  modify and/ or redistribute the software under the terms of the CeCILL-B
37 #  license as circulated by CEA, CNRS and INRIA at the following URL
38 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
39 #  or in the file LICENSE.txt.
40 #
41 #  As a counterpart to the access to the source code and  rights to copy,
42 #  modify and redistribute granted by the license, users are provided only
43 #  with a limited warranty  and the software's author,  the holder of the
44 #  economic rights,  and the successive licensors  have only  limited
45 #  liability.
46 #
47 #  The fact that you are presently reading this means that you have had
48 #  knowledge of the CeCILL-B license and that you accept its terms.
49 # ------------------------------------------------------------------------ */
50
51 /*=========================================================================
52
53   Program:   wxMaracas
54   Module:    $RCSfile: marInterfaceCT.h,v $
55   Language:  C++
56   Date:      $Date: 2012/11/15 14:15:31 $
57   Version:   $Revision: 1.2 $
58
59   Copyright: (c) 2002, 2003
60   License:
61   
62      This software is distributed WITHOUT ANY WARRANTY; without even 
63      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
64      PURPOSE.  See the above copyright notice for more information.
65
66 =========================================================================*/
67 #ifndef __MAR__KERNEL__INTERFACECT__HXX__
68 #define __MAR__KERNEL__INTERFACECT__HXX__
69
70 //#include "marDicom.h"
71 #include "marDicomBase.h"
72 #include "marKVolume.h"
73 #include "marExperimentCT.h"
74 #include "marAxisCT.h"
75 #include "marDynData.h"
76
77
78
79
80 class MAR_KERNEL_EXPORT marInterfaceCT
81 {
82   public:
83
84     marInterfaceCT( );
85     ~marInterfaceCT( );
86
87     bool loadParameters( std::string pFile );
88     bool saveParameters( std::string pFile );
89
90     bool loadParameters( ) {return loadParameters(m_paramFileName);}
91     bool saveParameters( ) {return saveParameters(m_paramFileName);}
92
93     bool initExperiment( );
94
95     bool saveExperiment( std::string nFile );
96 //    bool loadExperiment( wxString nFile );
97     bool loadExperiment( std::string nFile );
98
99     void reset( );
100
101         void            SetParamFileName(std::string pFileName); 
102         std::string GetParamFileName();
103         void            SetDicom(marFilesBase *dicom);
104         
105         void appendAxis( marAxis* ax );
106         marAxisCT* getAxis( int i = -1 ) ;
107         void setAxis( int i );
108
109         int   getQuantStart( );
110         int   getQuantFinish( );
111  
112
113         void prepareQuantification( );
114
115
116         vtkImageData*           getSliceImage( int i );
117         vtkProbeFilter* get3DSlice( int i );
118         double                  getTotalLength();
119         double                  getSubAxisLength();
120         double                  getReferenceArea();
121         double                  getReferenceAverDiam();
122         double                  getAverageArea(int pIni, int pEnd);
123         int                             getNumberOfSlices( );
124
125         marContour*             getContour( int point, int contour );
126     vtkPoints*          get3Dcontour( int point, int contour );
127     vtkPolyData*        get2Dcontour( int point, int contour );
128     vtkPoints*          get2DDiameterMin( int point, int contour );
129     vtkPoints*          get2DDiameterMax( int point, int contour );
130
131         marParameters*  getParameters();
132         marDynData*             getDynData();
133
134         void getVOI( int* voi ) { _experiment->getVOI(voi); };
135         void setVOI( int* voi ) { _experiment->setVOI(voi); };
136         int getActualQuant( );
137         int getHealthySlice( );
138         int getHealthySliceStart( );
139         int getHealthySliceEnd( );
140         void setHealthySlice( int hsS, int hs, int hsE );
141         void setActualQuant(int act);
142
143         void replaceContour2D(int i,int size,double *vx,double *vy);
144         void replaceContour2D(int size,double *vx,double *vy, int type);
145         void cleanContours(int type);
146         void EraseContour(int i);
147
148         void ClearContours();
149     void RegenerateAxis();
150     void RegenerateSignal();
151     void RecalculateAxis();
152         void ClearContoursPartial(int start);
153         
154         void getMinMax( double& min, double& max );
155
156         int getNumberOfContours(int point);
157
158         void updateLumenPercentage(int percentage);
159         void updateCalcPercentage(int percentage);
160         void updateDiscontinuityThreshold(int percentage);
161  
162         marIsocontour* loadMarIsocontour(int size, double *vx, double *vy);
163         double performXOR(int type, std::vector<marIsocontour*> manual);
164         double performAND(int type, std::vector<marIsocontour*> manual);
165         double performUnion(int type, std::vector<marIsocontour*> manual);
166
167         void histogram(int point) ;
168         
169
170
171
172         int     getContourType(int point, int index);
173         void                            setCalibration(bool calib);
174         bool                            getCalibration();
175         void                            setStartIndex(int start);
176
177         int                                     getPointSize();
178         marPoint*                       getPoint(int i);
179         void                            markUpLumen(int point);
180         void                            generateFile();
181
182         marExperimentCT* GetExperiment();
183
184     marFilesBase*               _dicom;
185         marParameters*          _parameters;
186         
187
188 protected:
189         std::string m_paramFileName;
190
191 private:
192         marExperimentCT*        _experiment;
193 };
194
195 #endif // __MAR__KERNEL__INTERFACECT__HXX__