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