]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/include/marExperimentCT.cpp
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / include / marExperimentCT.cpp
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: marExperimentCT.cpp,v $
30   Language:  C++
31   Date:      $Date: 2012/11/15 14:15:31 $
32   Version:   $Revision: 1.2 $
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
43
44 #include "marExperimentCT.h"
45
46
47 // ----------------------------------------------------------------------------
48 marExperimentCT::marExperimentCT( marParameters* p ) : marExperiment( p )
49                               
50 {
51   
52 }
53
54 // ----------------------------------------------------------------------------
55 marContour* marExperimentCT::getContour( int point, int contour ) {
56         return ((marAxisCT *)getAxis())->getContour(point,getDynData()->getVolume(),contour);
57 }
58
59 // ----------------------------------------------------------------------------
60 vtkPoints*      marExperimentCT::get3Dcontour( int point, int contour ) {
61         return ((marAxisCT *)getAxis())->get3Dcontour(point,getDynData()->getVolume(),contour);
62 }
63
64 // ----------------------------------------------------------------------------
65 vtkPolyData* marExperimentCT::get2Dcontour( int point, int contour ) {
66         return ((marAxisCT *)getAxis())->get2Dcontour(point,getDynData()->getVolume(),contour);
67 }
68
69 // ----------------------------------------------------------------------------
70 vtkPoints* marExperimentCT::get2DDiameterMin( int point, int contour ) {
71         return ((marAxisCT *)getAxis())->get2DDiameterMin(point,getDynData()->getVolume(),contour);
72 }
73
74 // ----------------------------------------------------------------------------
75 vtkPoints* marExperimentCT::get2DDiameterMax( int point, int contour ) {
76         return ((marAxisCT *)getAxis())->get2DDiameterMax(point,getDynData()->getVolume(),contour);;
77 }
78
79 // ----------------------------------------------------------------------------
80 int marExperimentCT::getNumberOfContours(int point) {
81         return ((marAxisCT *)getAxis())->getNumberOfContours(point,getDynData()->getVolume( )) ;
82 }
83
84 // ----------------------------------------------------------------------------
85 void marExperimentCT::prepareQuantification( ) {
86
87         if(getAxis())
88         {
89                 ((marAxisCT *)getAxis())->eraseContours();
90                 ((marAxisCT *)getAxis())->createEmptyContours();
91                 marExperiment::prepareQuantification();
92         }
93         
94 }
95
96 // ----------------------------------------------------------------------------
97 void marExperimentCT::RegenerateAxis() {
98
99         if (getAxis()!=NULL){
100                 ((marAxisCT *)getAxis())->eraseContours();
101                 ((marAxisCT *)getAxis())->createEmptyContours();
102         //      marExperiment::RegenerateAxis();
103         }
104
105         
106 }
107
108 // ----------------------------------------------------------------------------
109 void marExperimentCT::RecalculateAxis() {
110
111         if (getAxis()!=NULL){
112                 ((marAxisCT *)getAxis())->eraseContours();
113                 ((marAxisCT *)getAxis())->createEmptyContours();
114                 marExperiment::RecalculateAxis();
115         }
116         
117 }
118
119 // ----------------------------------------------------------------------------
120 void marExperimentCT::updateLumenPercentage(int percentage)
121 {
122         int point = ((marAxisCT *)getAxis())->getActualQuant();
123         ((marAxisCT *)getAxis())->getParameters()->setLumenPercentage(percentage);
124         ((marAxisCT *)getAxis())->updateLumenPercentage(point,getDynData()->getVolume());
125 }
126
127 // ----------------------------------------------------------------------------
128 void marExperimentCT::updateCalcPercentage(int percentage) 
129 {
130         int point = ((marAxisCT *)getAxis())->getActualQuant();
131         ((marAxisCT *)getAxis())->getParameters()->setCalcPercentage(percentage);
132         ((marAxisCT *)getAxis())->updateCalcPercentage(point,getDynData()->getVolume());
133 }
134
135 // ----------------------------------------------------------------------------
136 void marExperimentCT::updateDiscontinuityThreshold(int percentage)
137 {
138         ((marAxisCT *)getAxis())->getParameters()->setContourThresh(percentage);
139         ((marAxisCT *)getAxis())->eraseContours();
140         ((marAxisCT *)getAxis())->createEmptyContours();
141         ((marAxisCT *)getAxis())->setCalibration(false);
142
143 }
144
145
146
147 // ----------------------------------------------------------------------------
148 int     marExperimentCT::getContourType(int point, int index) {
149         return ((marAxisCT *)getAxis())->getContourType(point, index, getDynData()->getVolume());
150 }
151
152 // ----------------------------------------------------------------------------
153 void marExperimentCT::histogram(int point) {
154         
155         ((marAxisCT *)getAxis())->histogram(point, getDynData()->getVolume());
156 }
157
158 // ----------------------------------------------------------------------------
159 void marExperimentCT::setCalibration(bool calib)
160 {
161         ((marAxisCT *)getAxis())->setCalibration(calib);
162 }
163
164 // ----------------------------------------------------------------------------
165 bool marExperimentCT::getCalibration()
166 {
167         return ((marAxisCT *)getAxis())->getCalibration();
168 }
169
170 // ----------------------------------------------------------------------------
171 void marExperimentCT::ClearContoursPartial(int start)
172 {
173         ((marAxisCT *)getAxis())->eraseContoursPartial(start);
174 }
175
176 // ----------------------------------------------------------------------------
177 void marExperimentCT::setStartIndex(int start)
178 {
179         ((marAxisCT *)getAxis())->setStartIndex(start);
180 }
181
182 // ----------------------------------------------------------------------------
183 int     marExperimentCT::getPointSize()
184 {
185         return ((marAxisCT *)getAxis())->getPointSize();
186 }
187
188 // ----------------------------------------------------------------------------
189 marPoint* marExperimentCT::getPoint(int i)
190 {
191         return ((marAxisCT *)getAxis())->getPoint(i);
192 }
193
194 // ----------------------------------------------------------------------------
195 void marExperimentCT::markUpLumen(int point)
196 {
197         ((marAxisCT *)getAxis())->markUpLumen(point, getDynData()->getVolume());
198 }
199
200 // ----------------------------------------------------------------------------
201 void marExperimentCT::generateFile()
202 {
203         int point = ((marAxisCT *)getAxis())->getActualQuant();
204         ((marAxisCT *)getAxis())->generateFile(point, getDynData()->getVolume());
205 }
206
207 // ----------------------------------------------------------------------------
208 void marExperimentCT::replaceContour2D(int size,double *vx,double *vy, int type)
209 {
210         int point = ((marAxisCT *)getAxis())->getActualQuant();
211         ((marAxisCT *)getAxis())->replaceContour2D(point,size,vx,vy,type);
212 }
213
214 // ----------------------------------------------------------------------------
215 void marExperimentCT::cleanContours(int type)
216 {
217         int point = ((marAxisCT *)getAxis())->getActualQuant();
218         ((marAxisCT *)getAxis())->cleanContours(type,point);
219 }
220
221 // ----------------------------------------------------------------------------
222 marIsocontour* marExperimentCT::loadMarIsocontour(int size, double *vx, double *vy)
223 {
224         return ((marAxisCT *)getAxis())->loadMarIsocontour(size,vx,vy);
225 }
226
227 // ----------------------------------------------------------------------------
228 double marExperimentCT::performXOR(int type, std::vector<marIsocontour*> manual)
229 {
230         int point = ((marAxisCT *)getAxis())->getActualQuant();
231
232         return ((marAxisCT *)getAxis())->performXOR(type,point,manual, getDynData()->getVolume());
233 }
234
235 // ----------------------------------------------------------------------------
236 double marExperimentCT::performAND(int type, std::vector<marIsocontour*> manual)
237 {
238         int point = ((marAxisCT *)getAxis())->getActualQuant();
239          
240         return ((marAxisCT *)getAxis())->performAND(type,point,manual, getDynData()->getVolume());
241         
242
243 }
244
245 // ----------------------------------------------------------------------------
246 double marExperimentCT::performUnion(int type, std::vector<marIsocontour*> manual)
247 {
248         int point = ((marAxisCT *)getAxis())->getActualQuant();
249          
250         return ((marAxisCT *)getAxis())->performUnion(type,point,manual, getDynData()->getVolume());
251 }