]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.h
7003fcd421b3f42b4bb63c5a86ebf38109d5d15b
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / ContourExtractData.h
1
2 #ifndef __ContourExtractData_h_INCLUDED_H__
3 #define __ContourExtractData_h_INCLUDED_H__
4
5
6 #include "manualContourModel.h"
7 #include "marTypes.h"
8
9
10   //--------------------------------------------------------------------------
11   class creaMaracasVisu_EXPORT ContourExtractData 
12   {
13   public:
14         ContourExtractData(bool imagesResults=false);
15     ~ContourExtractData();
16
17 //----------------------------------------------------------------------
18         void SetImage( vtkImageData* imagedata);
19         void SetZtoBeAnalys( int z );
20
21         void SetLstManualContourModel( std::vector<manualBaseModel*> lstManConMod);
22         void GetValuesInsideCrown(      int *numberOfPixels,
23                                                                 std::vector<double> *pLstValue,
24                                                                 std::vector<double> *pLstValuePosX,
25                                                                 std::vector<double> *pLstValuePosY,
26                                                                 std::vector<double> *pLstValuePosZ);
27
28         void CalculateImageResult();
29         vtkImageData *GetVtkImageValueResult();
30         vtkImageData *GetVtkImageMaskResult();
31         void Statistics( std::vector<double> *inputLstValue, 
32                                         int     grayRangeMin,
33                                         int     grayRangeMax,
34                                         int             *rCountRange, 
35                                         int             *rsize, 
36                                         double  *rmin, 
37                                         double  *rmax,
38                                         double  *raverage,
39                                         double  *rstandardeviation);
40         void SetTypeOperation(int type);
41
42           //--Volume Statistics--
43           void InitVolumeStatistics();
44           void GetVolumeStatistics(int *vol_rCountRange, int *vol_rsize,
45                                                                 double *vol_minValue, double *vol_maxValue,
46                                                                 double *vol_average, double *vol_standardeviation);
47           
48           void ResetImageResult(int z);
49           void SetScalarRange(double min, double max);
50           void InitLstContoursLinesYPoints();
51           bool isInside(int x, int y, int typeOperation );
52         
53           //
54           // Asigns the sizeImageY.
55           // @param pSizeImageY - int
56           void SetSizeImageY(int pSizeImageY);
57           
58   private:
59         double                                                          scalarRange[2];
60         bool                                                            okImagesResults;
61
62         //
63         // List of contours to obtain the respective statistics.
64         //
65         std::vector<manualBaseModel*>   lstManConMod;
66
67         //
68         // Operation Type (AND,OR,XOR...)
69         //
70         int                                                                     _typeOperation;
71
72         int                                                                     zImage;
73         vtkImageData                                            *imagedata;
74         vtkImageData                                            *imagedataValueResult;
75         vtkImageData                                            *imagedataMaskResult;
76
77         //Size Y
78         int _sizeImageY;
79         
80         //
81         // Asigns the minimum and maximum points of the contour model in parameter.
82         // @param *minPoint - int
83         // @param *maxPoint - int
84         // @param *manualcontourmodel - manualBaseModel
85         //
86         void GetMinMaxPoint(int *minPoint, 
87                                                 int *maxPoint, 
88                                                 manualBaseModel *manualcontourmodel );
89         //
90         // Obtain the minimum and maximum point among the contours. The value is saved in the parameter
91         // pointers
92         // @param *minPoint - int pointer to the minPoint
93         // @param *maxPoint - int pointer to the maxPoint
94         //
95         void GetMinMaxPoint_Of_LstManConMod(    int *minPoint, 
96                                                                                         int *maxPoint);
97
98         int AnalisisContourInsideV2(int x, int y, int iContour );
99           
100         double GetDataValue(int x, int y, int z);
101         void PutVtkImageDataResultValue( int x, int y,int z, double value );
102         void InitVtkImagesResult();
103
104           //--Volume Statistics--
105           int           vol_rCountRange;
106           int           vol_rsize;
107           double        vol_minValue;
108           double        vol_maxValue;
109           double        vol_acum_average;
110           double        vol_acum_standardeviation;
111           void SetVolumeStatistics(int rCountRange, int rsize,
112                                                            double minValue,double maxValue,
113                                                            double acum_average, double acum_standardeviation);
114           
115           // Optimize IsInside
116           // List of contours , list of linesY, list of points over the line
117           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecX1;
118           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecY1;
119           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecX2;
120           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecY2;
121           void Fill_lstlstlstVecXY(int iContour, int sizeY);
122           
123
124
125   };
126
127
128 #endif  // __ContourExtractData_h_INCLUDED_H__
129