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 # ------------------------------------------------------------------------ */
27 #ifndef __pHistogram_h__
28 #define __pHistogram_h__
30 // --------------------------------------------------------------------------------------------
31 // WX headers inclusion.
32 // For compilers that support precompilation, includes <wx/wx.h>.
33 // --------------------------------------------------------------------------------------------
35 #include <wx/wxprec.h>
44 //--------------------------------------------------------------------------------------------
46 //--------------------------------------------------------------------------------------------
48 //---------------------
50 //---------------------
52 #include "vtkImageData.h"
53 #include "vtkMetaImageReader.h"
62 //--------------------------------------------------------------------------------------------
64 //--------------------------------------------------------------------------------------------
66 class pHistogram //:public wxObject
69 //----------------------------------------------------------------------------------------
71 //----------------------------------------------------------------------------------------
77 pHistogram(std::string filePath);
81 pHistogram(vtkImageData* imageData);
84 @param filePath: is the path where the image is
86 void setImagePath(std::string filePath);
88 Return the points of the histogram of the image
90 std::vector <int> getPoints();
92 Calculate the histogram and save it in the attribute points
93 it is used if the user had given the file's path
96 void buildHistogram();
98 Calculate the histogram and save it in the attribute points
99 it is used if the user had given the imageData
101 void buildHistogram(vtkImageData* imageData);
103 getting ready the points
105 void initializePoints(int xDimension);
107 constructing the histogram
109 void setPoints(vtkImageData* imageData);
111 Returns the poins of the histograms
113 vtkImageData* getHistogram();
115 hash por getting the index for the histogram vector of the original
118 int getIndex(double gValue);
122 void setSize(int nSize);
128 Get Size of the histogram
132 Get the maximum value of grey of the histogram
134 int getMaximumLevelOfGrey();
136 Get the minimum value of grey of the histogram
138 int getMinimumLevelOfGrey();
140 get a point of the Histogram
143 int getHistogramPoint(int gValue);
146 //----------------------------------------------------------------------------------------
147 // Attributes declaration
148 //----------------------------------------------------------------------------------------
151 Points of the histogram of
154 vtkImageData* points;
156 The path of the image
160 the size of histogram vector
164 Maximum Level of grey
166 double maxLevelOfGrey;
168 Minimum Level of grey
170 double minLevelOfGrey;
176 //DECLARE_CLASS (pHistogram)