Computer Assited Medical Intervention Tool Kit  version 5.0
ImageLutModel.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef ImageLutModel_H
27 #define ImageLutModel_H
28 
29 #include <vtkImageData.h>
30 #include <vtkSmartPointer.h>
31 
47 public:
49  ImageLutModel(vtkSmartPointer<vtkImageData>);
50 
53 
55  double getMinValue();
56 
58  double getMaxValue();
59 
61  void setNumberOfBins(int);
62 
64  int getNumberOfBins();
65 
67  double getMaxBinValue();
68 
70  double getBinValue(int);
71 
73  int getBinIndex(double);
74 
78  double getBinIndexAsDouble(double value, bool checkBound = true);
79 
81  int getPercentFromLevel(double);
82 
84  double getLevelFromPercent(int);
85 
87  int getPercentFromWindow(double);
88 
90  double getWindowFromPercent(int);
91 
92 private:
94  void updateHistogram();
95 
97  vtkSmartPointer<vtkImageData> image;
98 
100  double minValue;
101 
103  double maxValue;
104 
106  double* greyLevels;
107 
109  double highestGreyLevel;
110 
112  unsigned int nbHistoBins;
113 
114 };
115 
116 #endif // ImageLutModel_H
ImageLutModel::maxValue
double maxValue
Min the possible data value (given by the data type of the image)
Definition: ImageLutModel.h:126
ImageLutModel::getMaxBinValue
double getMaxBinValue()
get the highgest grey level value
Definition: ImageLutModel.cpp:101
ImageLutModel::~ImageLutModel
~ImageLutModel()
destructor
Definition: ImageLutModel.cpp:48
ImageLutModel::getWindowFromPercent
double getWindowFromPercent(int)
get window value from a percentage
Definition: ImageLutModel.cpp:174
ImageLutModel::getLevelFromPercent
double getLevelFromPercent(int)
get level value from a percentage
Definition: ImageLutModel.cpp:169
ImageLutModel::getPercentFromWindow
int getPercentFromWindow(double)
get window value as a percentage between 0 and 100
Definition: ImageLutModel.cpp:164
ImageLutModel::nbHistoBins
unsigned int nbHistoBins
size of greyLevels
Definition: ImageLutModel.h:135
ImageLutModel::getPercentFromLevel
int getPercentFromLevel(double)
get level value as a percentage between 0 and 100
Definition: ImageLutModel.cpp:159
ImageLutModel::getMinValue
double getMinValue()
get the minimal voxel value (lutMin)
Definition: ImageLutModel.cpp:141
ImageLutModel::updateHistogram
void updateHistogram()
update the histogram depending on the number of bins
Definition: ImageLutModel.cpp:54
Log.h
ImageLutModel::minValue
double minValue
Min the possible data value (given by the data type of the image)
Definition: ImageLutModel.h:123
ImageLutModel::getBinIndexAsDouble
double getBinIndexAsDouble(double value, bool checkBound=true)
image value to the histogram value (required to show the current level/window values on the graph)
Definition: ImageLutModel.cpp:121
ImageLutModel::ImageLutModel
ImageLutModel(vtkSmartPointer< vtkImageData >)
Constructor: set the image data.
Definition: ImageLutModel.cpp:32
ImageLutModel::image
vtkSmartPointer< vtkImageData > image
currently modeled image
Definition: ImageLutModel.h:120
ImageLutModel::getBinValue
double getBinValue(int)
get the number of voxels that end up in a given bin index
Definition: ImageLutModel.cpp:91
ImageLutModel::setNumberOfBins
void setNumberOfBins(int)
change the number of bins
Definition: ImageLutModel.cpp:151
ImageLutModel::getBinIndex
int getBinIndex(double)
image value to the histogram bin index (get the bin index of a given value)
Definition: ImageLutModel.cpp:107
ImageLutModel
The class ImageLutModel model the histogram of a given vtkImageData.
Definition: ImageLutModel.h:46
ImageLutModel::getMaxValue
double getMaxValue()
get the maximal voxel value (lutMax)
Definition: ImageLutModel.cpp:136
ImageLutModel::highestGreyLevel
double highestGreyLevel
highest number of grey level (highest value in greyLevels array)
Definition: ImageLutModel.h:132
ImageLutModel::getNumberOfBins
int getNumberOfBins()
get the current number of bins
Definition: ImageLutModel.cpp:146
ImageLutModel::greyLevels
double * greyLevels
Table containing histogram bins.
Definition: ImageLutModel.h:129
ImageLutModel.h