Computer Assited Medical Intervention Tool Kit  version 5.0
ImageLutModel Class Reference

The class ImageLutModel model the histogram of a given vtkImageData. More...

#include <ImageLutModel.h>

+ Collaboration diagram for ImageLutModel:

Public Member Functions

int getBinIndex (double)
 image value to the histogram bin index (get the bin index of a given value) More...
 
double getBinIndexAsDouble (double value, bool checkBound=true)
 image value to the histogram value (required to show the current level/window values on the graph) More...
 
double getBinValue (int)
 get the number of voxels that end up in a given bin index More...
 
double getLevelFromPercent (int)
 get level value from a percentage More...
 
double getMaxBinValue ()
 get the highgest grey level value More...
 
double getMaxValue ()
 get the maximal voxel value (lutMax) More...
 
double getMinValue ()
 get the minimal voxel value (lutMin) More...
 
int getNumberOfBins ()
 get the current number of bins More...
 
int getPercentFromLevel (double)
 get level value as a percentage between 0 and 100 More...
 
int getPercentFromWindow (double)
 get window value as a percentage between 0 and 100 More...
 
double getWindowFromPercent (int)
 get window value from a percentage More...
 
 ImageLutModel (vtkSmartPointer< vtkImageData >)
 Constructor: set the image data. More...
 
void setNumberOfBins (int)
 change the number of bins More...
 
 ~ImageLutModel ()
 destructor More...
 

Private Member Functions

void updateHistogram ()
 update the histogram depending on the number of bins More...
 

Private Attributes

double * greyLevels
 Table containing histogram bins. More...
 
double highestGreyLevel
 highest number of grey level (highest value in greyLevels array) More...
 
vtkSmartPointer< vtkImageData > image
 currently modeled image More...
 
double maxValue
 Min the possible data value (given by the data type of the image) More...
 
double minValue
 Min the possible data value (given by the data type of the image) More...
 
unsigned int nbHistoBins
 size of greyLevels More...
 

Detailed Description

The class ImageLutModel model the histogram of a given vtkImageData.

Uses double data type to manage the histogram. This allows for managin properly all type of voxel datatype.

Note
The ui is defined in the corresponding ImageLutWidget.ui

Constructor & Destructor Documentation

◆ ImageLutModel()

ImageLutModel::ImageLutModel ( vtkSmartPointer< vtkImageData >  image)

Constructor: set the image data.

References greyLevels, image, maxValue, minValue, nbHistoBins, and updateHistogram().

+ Here is the call graph for this function:

◆ ~ImageLutModel()

ImageLutModel::~ImageLutModel ( )

destructor

References greyLevels.

Member Function Documentation

◆ getBinIndex()

int ImageLutModel::getBinIndex ( double  value)

image value to the histogram bin index (get the bin index of a given value)

References getBinIndexAsDouble(), and nbHistoBins.

Referenced by updateHistogram().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBinIndexAsDouble()

double ImageLutModel::getBinIndexAsDouble ( double  value,
bool  checkBound = true 
)

image value to the histogram value (required to show the current level/window values on the graph)

Parameters
checkBoundif true, then value below lutMin and over lutMax return 0 and getNumberOfBins() - 1 respectively
valuethe pixel/voxel value to check the bin of

References maxValue, minValue, and nbHistoBins.

Referenced by ImageLutWidget::drawGraphics(), and getBinIndex().

+ Here is the caller graph for this function:

◆ getBinValue()

double ImageLutModel::getBinValue ( int  index)

get the number of voxels that end up in a given bin index

References greyLevels, and nbHistoBins.

Referenced by ImageLutWidget::drawGraphics(), and ImageLutWidget::showHistogramTooltip().

+ Here is the caller graph for this function:

◆ getLevelFromPercent()

double ImageLutModel::getLevelFromPercent ( int  levelPercent)

get level value from a percentage

References maxValue, and minValue.

Referenced by ImageLutWidget::levelSliderChanged().

+ Here is the caller graph for this function:

◆ getMaxBinValue()

double ImageLutModel::getMaxBinValue ( )

get the highgest grey level value

References highestGreyLevel.

Referenced by ImageLutWidget::drawGraphics().

+ Here is the caller graph for this function:

◆ getMaxValue()

double ImageLutModel::getMaxValue ( )

get the maximal voxel value (lutMax)

References maxValue.

Referenced by ImageLutWidget::initLevel(), ImageLutWidget::initWindow(), ImageLutWidget::resetLUT(), ImageLutWidget::showHistogramTooltip(), and ImageLutWidget::updateBinComboBox().

+ Here is the caller graph for this function:

◆ getMinValue()

double ImageLutModel::getMinValue ( )

get the minimal voxel value (lutMin)

References minValue.

Referenced by ImageLutWidget::initLevel(), ImageLutWidget::initWindow(), ImageLutWidget::resetLUT(), ImageLutWidget::showHistogramTooltip(), and ImageLutWidget::updateBinComboBox().

+ Here is the caller graph for this function:

◆ getNumberOfBins()

int ImageLutModel::getNumberOfBins ( )

get the current number of bins

References nbHistoBins.

Referenced by ImageLutWidget::binComboBoxChanged(), ImageLutWidget::drawGraphics(), ImageLutWidget::showHistogramTooltip(), and ImageLutWidget::updateBinComboBox().

+ Here is the caller graph for this function:

◆ getPercentFromLevel()

int ImageLutModel::getPercentFromLevel ( double  level)

get level value as a percentage between 0 and 100

References maxValue, and minValue.

Referenced by ImageLutWidget::initLevel(), and ImageLutWidget::levelSpinBoxChanged().

+ Here is the caller graph for this function:

◆ getPercentFromWindow()

int ImageLutModel::getPercentFromWindow ( double  window)

get window value as a percentage between 0 and 100

References maxValue, and minValue.

Referenced by ImageLutWidget::initWindow(), and ImageLutWidget::windowSpinBoxChanged().

+ Here is the caller graph for this function:

◆ getWindowFromPercent()

double ImageLutModel::getWindowFromPercent ( int  windowPercent)

get window value from a percentage

References maxValue, and minValue.

Referenced by ImageLutWidget::windowSliderChanged().

+ Here is the caller graph for this function:

◆ setNumberOfBins()

void ImageLutModel::setNumberOfBins ( int  binCount)

change the number of bins

References maxValue, minValue, nbHistoBins, and updateHistogram().

Referenced by ImageLutWidget::binComboBoxChanged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateHistogram()

void ImageLutModel::updateHistogram ( )
private

update the histogram depending on the number of bins

References getBinIndex(), greyLevels, highestGreyLevel, image, and nbHistoBins.

Referenced by ImageLutModel(), and setNumberOfBins().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ greyLevels

double* ImageLutModel::greyLevels
private

Table containing histogram bins.

Note
use double as it can have a high number of pixel of the same number

Referenced by getBinValue(), ImageLutModel(), updateHistogram(), and ~ImageLutModel().

◆ highestGreyLevel

double ImageLutModel::highestGreyLevel
private

highest number of grey level (highest value in greyLevels array)

Note
use double as it can have a high number of pixel of the same number

Referenced by getMaxBinValue(), and updateHistogram().

◆ image

vtkSmartPointer<vtkImageData> ImageLutModel::image
private

currently modeled image

Referenced by ImageLutModel(), and updateHistogram().

◆ maxValue

double ImageLutModel::maxValue
private

◆ minValue

double ImageLutModel::minValue
private

◆ nbHistoBins

unsigned int ImageLutModel::nbHistoBins
private

size of greyLevels

Note
the maximum number of histogram bins is UINT_MAX

Referenced by getBinIndex(), getBinIndexAsDouble(), getBinValue(), getNumberOfBins(), ImageLutModel(), setNumberOfBins(), and updateHistogram().


The documentation for this class was generated from the following files: