00001
00002 #ifndef __ContourExtractData_h_INCLUDED_H__
00003 #define __ContourExtractData_h_INCLUDED_H__
00004
00005
00006 #include "manualContourModel.h"
00007 #include "marTypes.h"
00008
00009
00010
00011 class creaMaracasVisu_EXPORT ContourExtractData
00012 {
00013 public:
00014 ContourExtractData(bool imagesResults=false);
00015 ~ContourExtractData();
00016
00017
00018 void SetImage( vtkImageData* imagedata);
00019 void SetZtoBeAnalys( int z );
00020
00021 void SetLstManualContourModel( std::vector<manualContourModel*> lstManConMod);
00022 void GetValuesInsideCrown( std::vector<double> *pLstValue,
00023 std::vector<double> *pLstValuePosX,
00024 std::vector<double> *pLstValuePosY,
00025 std::vector<double> *pLstValuePosZ);
00026
00027 void CalculateImageResult();
00028 vtkImageData *GetVtkImageValueResult();
00029 vtkImageData *GetVtkImageMaskResult();
00030 void Statistics( std::vector<double> *inputLstValue,
00031 int grayRangeMin,
00032 int grayRangeMax,
00033 int *rCountRange,
00034 int *rsize,
00035 double *rmin,
00036 double *rmax,
00037 double *raverage,
00038 double *rstandardeviation);
00039 void SetTypeOperation(int type);
00040
00041
00042 void InitVolumeStatistics();
00043 void GetVolumeStatistics(int *vol_rCountRange, int *vol_rsize,
00044 double *vol_minValue, double *vol_maxValue,
00045 double *vol_average, double *vol_standardeviation);
00046
00047 void ResetImageResult(int z);
00048
00049
00050 private:
00051 bool okImagesResults;
00052 std::vector<manualContourModel*> lstManConMod;
00053 int _typeOperation;
00054
00055 int zImage;
00056 vtkImageData *imagedata;
00057 vtkImageData *imagedataValueResult;
00058 vtkImageData *imagedataMaskResult;
00059
00060 bool isInside(int x, int y, int typeOperation );
00061 void GetMinMaxPoint(int *minPoint,
00062 int *maxPoint,
00063 manualContourModel *manualcontourmodel );
00064 void GetMinMaxPoint_Of_LstManConMod( int *minPoint,
00065 int *maxPoint);
00066
00067 int AnalisisContourInsideV2(int x, int y, int iContour );
00068
00069 double GetDataValue(int x, int y, int z);
00070 void PutVtkImageDataResultValue( int x, int y,int z, double value );
00071 void InitVtkImagesResult();
00072
00073
00074 int vol_rCountRange;
00075 int vol_rsize;
00076 double vol_minValue;
00077 double vol_maxValue;
00078 double vol_acum_average;
00079 double vol_acum_standardeviation;
00080 void SetVolumeStatistics(int rCountRange, int rsize,
00081 double minValue,double maxValue,
00082 double acum_average, double acum_standardeviation);
00083
00084
00085
00086 std::vector< std::vector< std::vector<double> > > _lstlstlstVecX1;
00087 std::vector< std::vector< std::vector<double> > > _lstlstlstVecY1;
00088 std::vector< std::vector< std::vector<double> > > _lstlstlstVecX2;
00089 std::vector< std::vector< std::vector<double> > > _lstlstlstVecY2;
00090 void Fill_lstlstlstVecXY(int iContour, int sizeY);
00091 void InitLstContoursLinesYPoints();
00092
00093 };
00094
00095
00096 #endif // __ContourExtractData_h_INCLUDED_H__
00097