1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 /*=========================================================================
29 Module: $RCSfile: marExperimentCT.cpp,v $
31 Date: $Date: 2012/11/15 14:15:31 $
32 Version: $Revision: 1.2 $
34 Copyright: (c) 2002, 2003
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.
41 =========================================================================*/
44 #include "marExperimentCT.h"
47 // ----------------------------------------------------------------------------
48 marExperimentCT::marExperimentCT( marParameters* p ) : marExperiment( p )
54 // ----------------------------------------------------------------------------
55 marContour* marExperimentCT::getContour( int point, int contour ) {
56 return ((marAxisCT *)getAxis())->getContour(point,getDynData()->getVolume(),contour);
59 // ----------------------------------------------------------------------------
60 vtkPoints* marExperimentCT::get3Dcontour( int point, int contour ) {
61 return ((marAxisCT *)getAxis())->get3Dcontour(point,getDynData()->getVolume(),contour);
64 // ----------------------------------------------------------------------------
65 vtkPolyData* marExperimentCT::get2Dcontour( int point, int contour ) {
66 return ((marAxisCT *)getAxis())->get2Dcontour(point,getDynData()->getVolume(),contour);
69 // ----------------------------------------------------------------------------
70 vtkPoints* marExperimentCT::get2DDiameterMin( int point, int contour ) {
71 return ((marAxisCT *)getAxis())->get2DDiameterMin(point,getDynData()->getVolume(),contour);
74 // ----------------------------------------------------------------------------
75 vtkPoints* marExperimentCT::get2DDiameterMax( int point, int contour ) {
76 return ((marAxisCT *)getAxis())->get2DDiameterMax(point,getDynData()->getVolume(),contour);;
79 // ----------------------------------------------------------------------------
80 int marExperimentCT::getNumberOfContours(int point) {
81 return ((marAxisCT *)getAxis())->getNumberOfContours(point,getDynData()->getVolume( )) ;
84 // ----------------------------------------------------------------------------
85 void marExperimentCT::prepareQuantification( ) {
89 ((marAxisCT *)getAxis())->eraseContours();
90 ((marAxisCT *)getAxis())->createEmptyContours();
91 marExperiment::prepareQuantification();
96 // ----------------------------------------------------------------------------
97 void marExperimentCT::RegenerateAxis() {
100 ((marAxisCT *)getAxis())->eraseContours();
101 ((marAxisCT *)getAxis())->createEmptyContours();
102 // marExperiment::RegenerateAxis();
108 // ----------------------------------------------------------------------------
109 void marExperimentCT::RecalculateAxis() {
111 if (getAxis()!=NULL){
112 ((marAxisCT *)getAxis())->eraseContours();
113 ((marAxisCT *)getAxis())->createEmptyContours();
114 marExperiment::RecalculateAxis();
119 // ----------------------------------------------------------------------------
120 void marExperimentCT::updateLumenPercentage(int percentage)
122 int point = ((marAxisCT *)getAxis())->getActualQuant();
123 ((marAxisCT *)getAxis())->getParameters()->setLumenPercentage(percentage);
124 ((marAxisCT *)getAxis())->updateLumenPercentage(point,getDynData()->getVolume());
127 // ----------------------------------------------------------------------------
128 void marExperimentCT::updateCalcPercentage(int percentage)
130 int point = ((marAxisCT *)getAxis())->getActualQuant();
131 ((marAxisCT *)getAxis())->getParameters()->setCalcPercentage(percentage);
132 ((marAxisCT *)getAxis())->updateCalcPercentage(point,getDynData()->getVolume());
135 // ----------------------------------------------------------------------------
136 void marExperimentCT::updateDiscontinuityThreshold(int percentage)
138 ((marAxisCT *)getAxis())->getParameters()->setContourThresh(percentage);
139 ((marAxisCT *)getAxis())->eraseContours();
140 ((marAxisCT *)getAxis())->createEmptyContours();
141 ((marAxisCT *)getAxis())->setCalibration(false);
147 // ----------------------------------------------------------------------------
148 int marExperimentCT::getContourType(int point, int index) {
149 return ((marAxisCT *)getAxis())->getContourType(point, index, getDynData()->getVolume());
152 // ----------------------------------------------------------------------------
153 void marExperimentCT::histogram(int point) {
155 ((marAxisCT *)getAxis())->histogram(point, getDynData()->getVolume());
158 // ----------------------------------------------------------------------------
159 void marExperimentCT::setCalibration(bool calib)
161 ((marAxisCT *)getAxis())->setCalibration(calib);
164 // ----------------------------------------------------------------------------
165 bool marExperimentCT::getCalibration()
167 return ((marAxisCT *)getAxis())->getCalibration();
170 // ----------------------------------------------------------------------------
171 void marExperimentCT::ClearContoursPartial(int start)
173 ((marAxisCT *)getAxis())->eraseContoursPartial(start);
176 // ----------------------------------------------------------------------------
177 void marExperimentCT::setStartIndex(int start)
179 ((marAxisCT *)getAxis())->setStartIndex(start);
182 // ----------------------------------------------------------------------------
183 int marExperimentCT::getPointSize()
185 return ((marAxisCT *)getAxis())->getPointSize();
188 // ----------------------------------------------------------------------------
189 marPoint* marExperimentCT::getPoint(int i)
191 return ((marAxisCT *)getAxis())->getPoint(i);
194 // ----------------------------------------------------------------------------
195 void marExperimentCT::markUpLumen(int point)
197 ((marAxisCT *)getAxis())->markUpLumen(point, getDynData()->getVolume());
200 // ----------------------------------------------------------------------------
201 void marExperimentCT::generateFile()
203 int point = ((marAxisCT *)getAxis())->getActualQuant();
204 ((marAxisCT *)getAxis())->generateFile(point, getDynData()->getVolume());
207 // ----------------------------------------------------------------------------
208 void marExperimentCT::replaceContour2D(int size,double *vx,double *vy, int type)
210 int point = ((marAxisCT *)getAxis())->getActualQuant();
211 ((marAxisCT *)getAxis())->replaceContour2D(point,size,vx,vy,type);
214 // ----------------------------------------------------------------------------
215 void marExperimentCT::cleanContours(int type)
217 int point = ((marAxisCT *)getAxis())->getActualQuant();
218 ((marAxisCT *)getAxis())->cleanContours(type,point);
221 // ----------------------------------------------------------------------------
222 marIsocontour* marExperimentCT::loadMarIsocontour(int size, double *vx, double *vy)
224 return ((marAxisCT *)getAxis())->loadMarIsocontour(size,vx,vy);
227 // ----------------------------------------------------------------------------
228 double marExperimentCT::performXOR(int type, std::vector<marIsocontour*> manual)
230 int point = ((marAxisCT *)getAxis())->getActualQuant();
232 return ((marAxisCT *)getAxis())->performXOR(type,point,manual, getDynData()->getVolume());
235 // ----------------------------------------------------------------------------
236 double marExperimentCT::performAND(int type, std::vector<marIsocontour*> manual)
238 int point = ((marAxisCT *)getAxis())->getActualQuant();
240 return ((marAxisCT *)getAxis())->performAND(type,point,manual, getDynData()->getVolume());
245 // ----------------------------------------------------------------------------
246 double marExperimentCT::performUnion(int type, std::vector<marIsocontour*> manual)
248 int point = ((marAxisCT *)getAxis())->getActualQuant();
250 return ((marAxisCT *)getAxis())->performUnion(type,point,manual, getDynData()->getVolume());