Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::SimpleImageHistogram Class Reference

Histogram implementation for mitk::Image data. More...

#include <mitkSimpleHistogram.h>

Inheritance diagram for mitk::SimpleImageHistogram:
Collaboration diagram for mitk::SimpleImageHistogram:

Public Types

typedef itk::Statistics::Histogram< double > HistogramType
 The underlying ITK histogram type. More...
 
typedef itk::Image< short, 3 > CTImage
 
typedef itk::ImageRegionIterator< CTImage > CTIteratorType
 
typedef itk::ImageRegionIteratorWithIndex< CTImage > CTIteratorIndexType
 
typedef itk::Image< unsigned char, 3 > BinImage
 
typedef itk::ImageRegionIterator< BinImage > BinIteratorType
 
typedef itk::ImageRegionIteratorWithIndex< BinImage > BinIteratorIndexType
 
typedef unsigned long CountType
 

Public Member Functions

 SimpleImageHistogram ()
 
 ~SimpleImageHistogram ()
 
bool GetValid ()
 Check whether the histogram has been computed successfully. More...
 
double GetMin () const override
 Returns the minimum value of the histogram. More...
 
double GetMax () const override
 Returns the maximum value of the histogram. More...
 
void ComputeFromBaseData (BaseData *source) override
 Compute the histogram from an image. More...
 
float GetRelativeBin (double start, double end) const override
 Get the relative frequency of bins in the range [start, end]. More...
 

Protected Attributes

HistogramType::ConstPointer histogram
 The computed ITK histogram. More...
 
bool valid
 Whether the histogram is valid. More...
 
unsigned int nBins
 Number of histogram bins. More...
 
double invLogHighest
 Inverse log of the highest bin frequency (for normalization). More...
 

Detailed Description

Histogram implementation for mitk::Image data.

Computes a histogram from an image using ITK's histogram facilities. The histogram is computed with 256 bins by default.

See also
SimpleHistogram
SimpleHistogramCache

Definition at line 79 of file mitkSimpleHistogram.h.

Member Typedef Documentation

◆ BinImage

Definition at line 104 of file mitkSimpleHistogram.h.

◆ BinIteratorIndexType

typedef itk::ImageRegionIteratorWithIndex<BinImage> mitk::SimpleImageHistogram::BinIteratorIndexType

Definition at line 106 of file mitkSimpleHistogram.h.

◆ BinIteratorType

typedef itk::ImageRegionIterator<BinImage> mitk::SimpleImageHistogram::BinIteratorType

Definition at line 105 of file mitkSimpleHistogram.h.

◆ CountType

Definition at line 108 of file mitkSimpleHistogram.h.

◆ CTImage

Definition at line 100 of file mitkSimpleHistogram.h.

◆ CTIteratorIndexType

typedef itk::ImageRegionIteratorWithIndex<CTImage> mitk::SimpleImageHistogram::CTIteratorIndexType

Definition at line 102 of file mitkSimpleHistogram.h.

◆ CTIteratorType

typedef itk::ImageRegionIterator<CTImage> mitk::SimpleImageHistogram::CTIteratorType

Definition at line 101 of file mitkSimpleHistogram.h.

◆ HistogramType

typedef itk::Statistics::Histogram<double> mitk::SimpleImageHistogram::HistogramType

The underlying ITK histogram type.

Definition at line 83 of file mitkSimpleHistogram.h.

Constructor & Destructor Documentation

◆ SimpleImageHistogram()

mitk::SimpleImageHistogram::SimpleImageHistogram ( )
inline

Definition at line 85 of file mitkSimpleHistogram.h.

◆ ~SimpleImageHistogram()

mitk::SimpleImageHistogram::~SimpleImageHistogram ( )
inline

Definition at line 90 of file mitkSimpleHistogram.h.

Member Function Documentation

◆ ComputeFromBaseData()

void mitk::SimpleImageHistogram::ComputeFromBaseData ( BaseData *  source)
overridevirtual

Compute the histogram from an image.

Does nothing if the source is invalid, nullptr, or not an Image.

Parameters
[in]sourceThe BaseData (must be a mitk::Image) to compute the histogram from.

Implements mitk::SimpleHistogram.

◆ GetMax()

double mitk::SimpleImageHistogram::GetMax ( ) const
overridevirtual

Returns the maximum value of the histogram.

Implements mitk::SimpleHistogram.

◆ GetMin()

double mitk::SimpleImageHistogram::GetMin ( ) const
overridevirtual

Returns the minimum value of the histogram.

Implements mitk::SimpleHistogram.

◆ GetRelativeBin()

float mitk::SimpleImageHistogram::GetRelativeBin ( double  start,
double  end 
) const
overridevirtual

Get the relative frequency of bins in the range [start, end].

Parameters
[in]startThe start of the bin range.
[in]endThe end of the bin range.
Returns
The relative frequency as a float in [0, 1].

Implements mitk::SimpleHistogram.

◆ GetValid()

bool mitk::SimpleImageHistogram::GetValid ( )

Check whether the histogram has been computed successfully.

Returns
True if the histogram is valid, false otherwise.

Member Data Documentation

◆ histogram

HistogramType::ConstPointer mitk::SimpleImageHistogram::histogram
protected

The computed ITK histogram.

Definition at line 111 of file mitkSimpleHistogram.h.

◆ invLogHighest

double mitk::SimpleImageHistogram::invLogHighest
protected

Inverse log of the highest bin frequency (for normalization).

Definition at line 115 of file mitkSimpleHistogram.h.

◆ nBins

unsigned int mitk::SimpleImageHistogram::nBins
protected

Number of histogram bins.

Definition at line 114 of file mitkSimpleHistogram.h.

◆ valid

bool mitk::SimpleImageHistogram::valid
protected

Whether the histogram is valid.

Definition at line 113 of file mitkSimpleHistogram.h.


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