]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/include/marAxisCT.h
BUG macOs
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / include / marAxisCT.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: marAxisCT.h,v $
5   Language:  C++
6   Date:      $Date: 2009/05/14 13:55:07 $
7   Version:   $Revision: 1.1 $
8
9   Copyright: (c) 2002, 2003
10   License:
11   
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notice for more information.
15
16 =========================================================================*/
17
18 #ifndef __MAR__KERNEL__AXISCT__HXX__
19 #define __MAR__KERNEL__AXISCT__HXX__
20
21
22
23 #include <marAxis.h>
24 #include <marAxisContours.h>
25 #include <marPoint.h>
26 #include <marIsocontour.h>
27 #include <vector>
28 #include <list>
29
30 class MAR_KERNEL_EXPORT marAxisCT : public marAxis
31 {
32
33 public:
34
35                 
36         marAxisCT(  );
37         marContour*             getContour( int point , kVolume* vol, int index );              // DATA-MODEL-2D  
38         vtkPoints*              get3Dcontour(   int point , kVolume* vol, int index );          // VISUALISATION-VTK 3D
39         vtkPolyData*    get2Dcontour(   int point , kVolume* vol, int index );          // VISUALISATION-VTK 2D
40         vtkPoints*              get2DDiameterMin(       int point , kVolume* vol, int index );          // VISUALISATION-VTK 3D
41         vtkPoints*              get2DDiameterMax(       int point , kVolume* vol, int index );          // VISUALISATION-VTK 3D
42         int                             getSignal(int point, int index, kVolume* vol);
43         void                    updateLumenPercentage(int point, kVolume* vol);
44         void                    updateCalcPercentage(int point, kVolume* vol);
45
46         void                    replaceContour2D(int point,int size,double *vx,double *vy, int type);
47
48         marContourVO*   searchContour(int type, int point);
49         int                     getNumberOfContours(int point, kVolume* vol);
50         int                     getContourType(int point, int index, kVolume* vol  );
51         void            createEmptyContours();
52         void            eraseContours();
53         void            eraseContoursPartial(int start);
54         
55         void                    histogram(int point, kVolume* vol);
56         void            setCalibration(bool calib);
57         bool            getCalibration();
58         
59         int                     getStartIndex();
60         void            setStartIndex(int start);
61
62         int                     getPointSize();
63         marPoint*       getPoint(int i);
64         void            markUpLumen(int point, kVolume* vol);
65         void            generateFile(int point,kVolume* vol);
66
67         void            cleanContours(int type, int point);
68         double          performXOR(int type, int point, std::vector<marIsocontour *> manual, kVolume* vol);
69         double          performAND(int type, int point, std::vector<marIsocontour *> manual, kVolume* vol);
70         double          performUnion(int type, int point, std::vector<marIsocontour *> manual, kVolume* vol);
71         marIsocontour*  loadMarIsocontour(int size, double *vx, double *vy);
72
73
74 private:
75
76         void                    createContours(         int point       , kVolume* vol );
77         void                    create3Dcontours(       int point       , kVolume* vol );
78         void                    create2Dcontours(       int point       , kVolume* vol );
79         void                    create2DDiametersMin(int point  , kVolume* vol );
80         void                    create2DDiametersMax(int point  , kVolume* vol );
81         void                    createSignals (int point, kVolume* vol);
82         void                    generatePoints(int point, kVolume* vol, std::vector<marIsocontour*> *list);
83         int                             getMaximumGrad(std::vector <marPoint *> list, int iniPos, int limit, double threshold);
84         int                             getMinimumGrad(std::vector <marPoint *> list, int iniPos, int limit, double threshold);
85         double                  interpolate(double x, double y, vtkImageData* imagedata);
86         void                    generateVector(int dir,int *coordBase,double originX,double originY,double *x,double *y);
87         bool                    detectNeighbor(marIsocontour* contour,int dir, int type);
88         marIsocontour*  addPointToContour(marIsocontour* cont ,bool inside,int type,marPoint* point);
89         void                    unifyDividedStructure(std::vector<marIsocontour*> *contList);
90         double                  getStatistics(marIsocontour* contour, double x, double y, vtkImageData* imagedata);
91         double                  getCalcStatistics(marIsocontour* contour, double x, double y, vtkImageData* imagedata,int i);
92         int                             round(double num);
93         int                             getMaxIntensity(int point);
94         bool                    pointInPolygon(marIsocontour *c, double x, double y);
95         marIsocontour*  parsePolyDataToMarIsocontour(marContourVO* contourVO);
96
97         marIsocontour*  filterContour(marIsocontour* contExt, marIsocontour* contInt, double radio);
98         
99         double                  obtainContourArea(marIsocontour*contour);
100         void                    adjustWall(int point, kVolume* vol);
101         void                    adjustCalcification(int point, kVolume* vol);
102         void                    adjustContour(int point, kVolume* vol);
103         int                             maxValue(std::vector <double> list);
104         int                             getDiameter(marContourVO* contourVO, double x, double y, int limInfX, int limInfY, int limSupX, int limSupY);
105         
106         int                             searchData(std::vector<double> vec, double value);
107
108         void                    extractLumen(vtkImageData *lumenImage, marIsocontour *lumenContour, int point);
109         double                  avgValue;
110         double                  stdValue;
111         int                             startIndex;
112         double                  maxSignal;
113
114         
115         
116                                 //      Contours per slice
117
118         //Eliminados
119         //      marIsocontour*  shrinkContour(marIsocontour *cont, double thresh, vtkImageData* imageData, double radio);
120   
121 };
122
123 #endif // __MAR__KERNEL__AXISCT__HXX__