]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pHistogram.h
3ef66b7d88b88a8328663254aaaaf08b93b0212e
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pHistogram.h
1 /*
2 #ifndef __pHistogram_h__
3 #define __pHistogram_h__
4
5 // --------------------------------------------------------------------------------------------
6 // WX headers inclusion.
7 // For compilers that support precompilation, includes <wx/wx.h>.
8 // --------------------------------------------------------------------------------------------
9
10 #include <wx/wxprec.h>
11 #ifdef __BORLANDC__
12 #pragma hdrstop
13 #endif
14 #ifndef WX_PRECOMP
15 #include <wx/wx.h>
16 #endif
17 */
18
19 //--------------------------------------------------------------------------------------------
20 // Includes
21 //--------------------------------------------------------------------------------------------
22
23 //---------------------
24 // VTK
25 //---------------------
26
27 #include "vtkImageData.h"
28 #include "vtkMetaImageReader.h"
29
30
31 //-----------------
32 // C++
33 //-----------------
34 #include <iostream>
35 #include <string>
36 #include <vector>
37 //--------------------------------------------------------------------------------------------
38 // Class definition
39 //--------------------------------------------------------------------------------------------
40
41 class pHistogram //:public wxObject
42 {
43
44         //----------------------------------------------------------------------------------------
45         // Methods definition
46         //----------------------------------------------------------------------------------------
47         public:
48                 
49                 /*
50                  Constructor
51                 */
52                 pHistogram(std::string filePath);
53                 /*
54                  Constructor
55                 */
56                 pHistogram(vtkImageData* imageData);
57                 ~pHistogram();
58                 /*
59                  @param filePath: is the path where the image is 
60                 */
61                 void setImagePath(std::string filePath);
62                 /*
63                  Return the points of the histogram of the image
64                 */
65                 std::vector <int> getPoints();
66                 /*
67                  Calculate the histogram and save it in the attribute points
68                  it is used if the user had given the file's path
69                 */
70 //private:      
71                 void buildHistogram();
72                 /*
73                  Calculate the histogram and save it in the attribute points
74                  it is used if the user had given the imageData
75                 */
76                 void buildHistogram(vtkImageData* imageData);
77                 /*
78                 getting ready the points
79                 */
80                 void initializePoints(int xDimension);
81                 /*
82                 constructing the histogram
83                 */
84                 void setPoints(vtkImageData* imageData);
85                 /*
86                 Returns the poins of the histograms
87                 */
88                 vtkImageData* getHistogram();
89                 /*
90                   hash por getting the index for the histogram vector of the original
91                   image
92                 */
93                 int getIndex(int gValue);
94                 /*
95                 Setting the size
96                 */
97                 void setSize(int nSize);
98                 /*
99                  Get Image Size
100                 */
101                 int getImageSize();
102                 /*
103                  Get Size of the histogram
104                 */
105                 int getSize();
106                 /*
107                  Get the maximum value of grey of the histogram
108                 */
109                 int getMaximumLevelOfGrey();
110                 /*
111                  Get the minimum value of grey of the histogram
112                 */
113                 int getMinimumLevelOfGrey();
114                 /*
115                 get a point of the Histogram
116                 given the grey value
117                 */
118                 int getHistogramPoint(int gValue);
119
120
121         //----------------------------------------------------------------------------------------
122         // Attributes declaration
123         //----------------------------------------------------------------------------------------
124         private: 
125                 /*
126                  Points of the histogram of 
127                  the image
128                 */
129                 vtkImageData* points;
130                 /*
131                  The path of the image
132                 */
133                 std::string path;
134                 /*
135                  the size of histogram vector
136                 */
137                 int size;
138                 /*
139                  Maximum Level of grey
140                 */
141                 int maxLevelOfGrey;
142                 /*
143                  Minimum Level of grey
144                 */
145                 int minLevelOfGrey;
146                 /*
147                  image size
148                 */
149                 int sizeImage;
150
151         //DECLARE_CLASS (pHistogram)
152 };
153
154 //#endif
155
156