]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.h
a1d4ddc3ee27679360d2e12e89e763b73363413b
[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<manualContourModel*> 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           
49           
50   private:
51         bool                                                            okImagesResults;
52         std::vector<manualContourModel*>        lstManConMod;
53         int                                                                     _typeOperation;
54
55         int                                                                     zImage;
56         vtkImageData                                            *imagedata;
57         vtkImageData                                            *imagedataValueResult;
58         vtkImageData                                            *imagedataMaskResult;
59
60         bool isInside(int x, int y, int typeOperation );
61         void GetMinMaxPoint(int *minPoint, 
62                                                 int *maxPoint, 
63                                                 manualContourModel *manualcontourmodel );
64         void GetMinMaxPoint_Of_LstManConMod(    int *minPoint, 
65                                                                                         int *maxPoint);
66
67         int AnalisisContourInside(      int x, 
68                                                                 int y, 
69                                                                 manualContourModel *manualcontourmodel );
70         int AnalisisContourInsideV2(int x, int y, int iContour );
71           
72         double GetDataValue(int x, int y, int z);
73         void PutVtkImageDataResultValue( int x, int y,int z, double value );
74         void InitVtkImagesResult();
75
76           //--Volume Statistics--
77           int           vol_rCountRange;
78           int           vol_rsize;
79           double        vol_minValue;
80           double        vol_maxValue;
81           double        vol_acum_average;
82           double        vol_acum_standardeviation;
83           void SetVolumeStatistics(int rCountRange, int rsize,
84                                                            double minValue,double maxValue,
85                                                            double acum_average, double acum_standardeviation);
86           
87           // Optimize IsInside
88           // List of contours , list of linesY, list of points over the line
89           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecX1;
90           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecY1;
91           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecX2;
92           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecY2;
93           void Fill_lstlstlstVecXY(int iContour, int sizeY);
94           void InitLstContoursLinesYPoints();
95
96   };
97
98
99 #endif  // __ContourExtractData_h_INCLUDED_H__
100