]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.h
b463709d2c5cb94ce79d37f1587e5f424a065475
[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           
49           
50   private:
51         bool                                                            okImagesResults;
52
53         //
54         // List of contours to obtain the respective statistics.
55         //
56         std::vector<manualBaseModel*>   lstManConMod;
57
58         //
59         // Operation Type (AND,OR,XOR...)
60         //
61         int                                                                     _typeOperation;
62
63         int                                                                     zImage;
64         vtkImageData                                            *imagedata;
65         vtkImageData                                            *imagedataValueResult;
66         vtkImageData                                            *imagedataMaskResult;
67
68         bool isInside(int x, int y, int typeOperation );
69
70         //
71         // Asigns the minimum and maximum points of the contour model in parameter.
72         // @param *minPoint - int
73         // @param *maxPoint - int
74         // @param *manualcontourmodel - manualBaseModel
75         //
76         void GetMinMaxPoint(int *minPoint, 
77                                                 int *maxPoint, 
78                                                 manualBaseModel *manualcontourmodel );
79         //
80         // Obtain the minimum and maximum point among the contours. The value is saved in the parameter
81         // pointers
82         // @param *minPoint - int pointer to the minPoint
83         // @param *maxPoint - int pointer to the maxPoint
84         //
85         void GetMinMaxPoint_Of_LstManConMod(    int *minPoint, 
86                                                                                         int *maxPoint);
87
88         int AnalisisContourInsideV2(int x, int y, int iContour );
89           
90         double GetDataValue(int x, int y, int z);
91         void PutVtkImageDataResultValue( int x, int y,int z, double value );
92         void InitVtkImagesResult();
93
94           //--Volume Statistics--
95           int           vol_rCountRange;
96           int           vol_rsize;
97           double        vol_minValue;
98           double        vol_maxValue;
99           double        vol_acum_average;
100           double        vol_acum_standardeviation;
101           void SetVolumeStatistics(int rCountRange, int rsize,
102                                                            double minValue,double maxValue,
103                                                            double acum_average, double acum_standardeviation);
104           
105           // Optimize IsInside
106           // List of contours , list of linesY, list of points over the line
107           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecX1;
108           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecY1;
109           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecX2;
110           std::vector< std::vector< std::vector<double> > >             _lstlstlstVecY2;
111           void Fill_lstlstlstVecXY(int iContour, int sizeY);
112           void InitLstContoursLinesYPoints();
113
114   };
115
116
117 #endif  // __ContourExtractData_h_INCLUDED_H__
118