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: marAxisCT.h,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 =========================================================================*/
43 #ifndef __MAR__KERNEL__AXISCT__HXX__
44 #define __MAR__KERNEL__AXISCT__HXX__
49 #include <marAxisContours.h>
51 #include <marIsocontour.h>
55 class MAR_KERNEL_EXPORT marAxisCT : public marAxis
62 marContour* getContour( int point , kVolume* vol, int index ); // DATA-MODEL-2D
63 vtkPoints* get3Dcontour( int point , kVolume* vol, int index ); // VISUALISATION-VTK 3D
64 vtkPolyData* get2Dcontour( int point , kVolume* vol, int index ); // VISUALISATION-VTK 2D
65 vtkPoints* get2DDiameterMin( int point , kVolume* vol, int index ); // VISUALISATION-VTK 3D
66 vtkPoints* get2DDiameterMax( int point , kVolume* vol, int index ); // VISUALISATION-VTK 3D
67 int getSignal(int point, int index, kVolume* vol);
68 void updateLumenPercentage(int point, kVolume* vol);
69 void updateCalcPercentage(int point, kVolume* vol);
71 void replaceContour2D(int point,int size,double *vx,double *vy, int type);
73 marContourVO* searchContour(int type, int point);
74 int getNumberOfContours(int point, kVolume* vol);
75 int getContourType(int point, int index, kVolume* vol );
76 void createEmptyContours();
78 void eraseContoursPartial(int start);
80 void histogram(int point, kVolume* vol);
81 void setCalibration(bool calib);
82 bool getCalibration();
85 void setStartIndex(int start);
88 marPoint* getPoint(int i);
89 void markUpLumen(int point, kVolume* vol);
90 void generateFile(int point,kVolume* vol);
92 void cleanContours(int type, int point);
93 double performXOR(int type, int point, std::vector<marIsocontour *> manual, kVolume* vol);
94 double performAND(int type, int point, std::vector<marIsocontour *> manual, kVolume* vol);
95 double performUnion(int type, int point, std::vector<marIsocontour *> manual, kVolume* vol);
96 marIsocontour* loadMarIsocontour(int size, double *vx, double *vy);
101 void createContours( int point , kVolume* vol );
102 void create3Dcontours( int point , kVolume* vol );
103 void create2Dcontours( int point , kVolume* vol );
104 void create2DDiametersMin(int point , kVolume* vol );
105 void create2DDiametersMax(int point , kVolume* vol );
106 void createSignals (int point, kVolume* vol);
107 void generatePoints(int point, kVolume* vol, std::vector<marIsocontour*> *list);
108 int getMaximumGrad(std::vector <marPoint *> list, int iniPos, int limit, double threshold);
109 int getMinimumGrad(std::vector <marPoint *> list, int iniPos, int limit, double threshold);
110 double interpolate(double x, double y, vtkImageData* imagedata);
111 void generateVector(int dir,int *coordBase,double originX,double originY,double *x,double *y);
112 bool detectNeighbor(marIsocontour* contour,int dir, int type);
113 marIsocontour* addPointToContour(marIsocontour* cont ,bool inside,int type,marPoint* point);
114 void unifyDividedStructure(std::vector<marIsocontour*> *contList);
115 double getStatistics(marIsocontour* contour, double x, double y, vtkImageData* imagedata);
116 double getCalcStatistics(marIsocontour* contour, double x, double y, vtkImageData* imagedata,int i);
117 int round(double num);
118 int getMaxIntensity(int point);
119 bool pointInPolygon(marIsocontour *c, double x, double y);
120 marIsocontour* parsePolyDataToMarIsocontour(marContourVO* contourVO);
122 marIsocontour* filterContour(marIsocontour* contExt, marIsocontour* contInt, double radio);
124 double obtainContourArea(marIsocontour*contour);
125 void adjustWall(int point, kVolume* vol);
126 void adjustCalcification(int point, kVolume* vol);
127 void adjustContour(int point, kVolume* vol);
128 int maxValue(std::vector <double> list);
129 int getDiameter(marContourVO* contourVO, double x, double y, int limInfX, int limInfY, int limSupX, int limSupY);
131 int searchData(std::vector<double> vec, double value);
133 void extractLumen(vtkImageData *lumenImage, marIsocontour *lumenContour, int point);
141 // Contours per slice
144 // marIsocontour* shrinkContour(marIsocontour *cont, double thresh, vtkImageData* imageData, double radio);
148 #endif // __MAR__KERNEL__AXISCT__HXX__