]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/include/marAxisCT.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / include / marAxisCT.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: marAxisCT.h,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 #ifndef __MAR__KERNEL__AXISCT__HXX__
44 #define __MAR__KERNEL__AXISCT__HXX__
45
46
47
48 #include <marAxis.h>
49 #include <marAxisContours.h>
50 #include <marPoint.h>
51 #include <marIsocontour.h>
52 #include <vector>
53 #include <list>
54
55 class MAR_KERNEL_EXPORT marAxisCT : public marAxis
56 {
57
58 public:
59
60                 
61         marAxisCT(  );
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);
70
71         void                    replaceContour2D(int point,int size,double *vx,double *vy, int type);
72
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();
77         void            eraseContours();
78         void            eraseContoursPartial(int start);
79         
80         void                    histogram(int point, kVolume* vol);
81         void            setCalibration(bool calib);
82         bool            getCalibration();
83         
84         int                     getStartIndex();
85         void            setStartIndex(int start);
86
87         int                     getPointSize();
88         marPoint*       getPoint(int i);
89         void            markUpLumen(int point, kVolume* vol);
90         void            generateFile(int point,kVolume* vol);
91
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);
97
98
99 private:
100
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);
121
122         marIsocontour*  filterContour(marIsocontour* contExt, marIsocontour* contInt, double radio);
123         
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);
130         
131         int                             searchData(std::vector<double> vec, double value);
132
133         void                    extractLumen(vtkImageData *lumenImage, marIsocontour *lumenContour, int point);
134         double                  avgValue;
135         double                  stdValue;
136         int                             startIndex;
137         double                  maxSignal;
138
139         
140         
141                                 //      Contours per slice
142
143         //Eliminados
144         //      marIsocontour*  shrinkContour(marIsocontour *cont, double thresh, vtkImageData* imageData, double radio);
145   
146 };
147
148 #endif // __MAR__KERNEL__AXISCT__HXX__