1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #ifndef __ContourExtractData_h_INCLUDED_H__
27 #define __ContourExtractData_h_INCLUDED_H__
30 #include "manualContourModel.h"
34 //--------------------------------------------------------------------------
35 class creaMaracasVisu_EXPORT ContourExtractData
38 ContourExtractData(bool imagesResults=false);
39 ~ContourExtractData();
41 //----------------------------------------------------------------------
42 void SetImage( vtkImageData* imagedata);
43 void SetZtoBeAnalys( int z );
45 void SetLstManualContourModel( std::vector<manualBaseModel*> lstManConMod);
46 void GetValuesInsideCrown( int *numberOfPixels,
47 std::vector<double> *pLstValue,
48 std::vector<double> *pLstValuePosX,
49 std::vector<double> *pLstValuePosY,
50 std::vector<double> *pLstValuePosZ);
52 void CalculateImageResult();
53 vtkImageData *GetVtkImageValueResult();
54 vtkImageData *GetVtkImageMaskResult();
55 void Statistics( std::vector<double> *inputLstValue,
63 double *rstandardeviation);
64 void SetTypeOperation(int type);
66 //--Volume Statistics--
67 void InitVolumeStatistics();
68 void GetVolumeStatistics(int *vol_rCountRange, int *vol_rsize,
69 double *vol_minValue, double *vol_maxValue,
70 double *vol_average, double *vol_standardeviation);
72 void ResetImageResult(int z);
73 void SetScalarRange(double min, double max);
74 void InitLstContoursLinesYPoints();
75 bool isInside(int x, int y, int typeOperation );
78 // Asigns the sizeImageY.
79 // @param pSizeImageY - int
80 void SetSizeImageY(int pSizeImageY);
83 double scalarRange[2];
87 // List of contours to obtain the respective statistics.
89 std::vector<manualBaseModel*> lstManConMod;
92 // Operation Type (AND,OR,XOR...)
97 vtkImageData *imagedata;
98 vtkImageData *imagedataValueResult;
99 vtkImageData *imagedataMaskResult;
105 // Asigns the minimum and maximum points of the contour model in parameter.
106 // @param *minPoint - int
107 // @param *maxPoint - int
108 // @param *manualcontourmodel - manualBaseModel
110 void GetMinMaxPoint(int *minPoint,
112 manualBaseModel *manualcontourmodel );
114 // Obtain the minimum and maximum point among the contours. The value is saved in the parameter
116 // @param *minPoint - int pointer to the minPoint
117 // @param *maxPoint - int pointer to the maxPoint
119 void GetMinMaxPoint_Of_LstManConMod( int *minPoint,
122 int AnalisisContourInsideV2(int x, int y, int iContour );
124 double GetDataValue(int x, int y, int z);
125 void PutVtkImageDataResultValue( int x, int y,int z, double value );
126 void InitVtkImagesResult();
128 //--Volume Statistics--
133 double vol_acum_average;
134 double vol_acum_standardeviation;
135 void SetVolumeStatistics(int rCountRange, int rsize,
136 double minValue,double maxValue,
137 double acum_average, double acum_standardeviation);
140 // List of contours , list of linesY, list of points over the line
141 std::vector< std::vector< std::vector<double> > > _lstlstlstVecX1;
142 std::vector< std::vector< std::vector<double> > > _lstlstlstVecY1;
143 std::vector< std::vector< std::vector<double> > > _lstlstlstVecX2;
144 std::vector< std::vector< std::vector<double> > > _lstlstlstVecY2;
145 void Fill_lstlstlstVecXY(int iContour, int sizeY);
152 #endif // __ContourExtractData_h_INCLUDED_H__