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