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

Maps continuous image intensity values to discrete histogram bin indices. More...

#include <mitkIntensityQuantifier.h>

Inheritance diagram for mitk::IntensityQuantifier:
Collaboration diagram for mitk::IntensityQuantifier:

Public Member Functions

 mitkClassMacro (IntensityQuantifier, BaseData)
 
Pointer Clone () const
 
 IntensityQuantifier ()
 
void InitializeByMinimumMaximum (double minimum, double maximum, unsigned int bins)
 Initialize with explicit minimum, maximum, and number of bins. More...
 
void InitializeByBinsizeAndBins (double minimum, unsigned int bins, double binsize)
 Initialize with explicit minimum, number of bins, and bin size. More...
 
void InitializeByBinsizeAndMaximum (double minimum, double maximum, double binsize)
 Initialize with explicit minimum, maximum, and bin size. More...
 
void InitializeByImage (const Image *image, unsigned int bins)
 Initialize from the full intensity range of an image. More...
 
void InitializeByImageAndMaximum (const Image *image, double maximum, unsigned int bins)
 Initialize from an image with a specified maximum; minimum is computed from the image. More...
 
void InitializeByImageAndMinimum (const Image *image, double minimum, unsigned int bins)
 Initialize from an image with a specified minimum; maximum is computed from the image. More...
 
void InitializeByImageRegion (const Image *image, const Image *mask, unsigned int bins)
 Initialize from the intensity range of masked voxels in an image. More...
 
void InitializeByImageRegionAndMinimum (const Image *image, const Image *mask, double minimum, unsigned int bins)
 Initialize from masked image region with a specified minimum; maximum is computed. More...
 
void InitializeByImageRegionAndMaximum (const Image *image, const Image *mask, double maximum, unsigned int bins)
 Initialize from masked image region with a specified maximum; minimum is computed. More...
 
void InitializeByImageAndBinsize (const Image *image, double binsize)
 Initialize from the full image intensity range using a specified bin size. More...
 
void InitializeByImageAndBinsizeAndMinimum (const Image *image, double minimum, double binsize)
 Initialize from an image with specified minimum and bin size; maximum is computed. More...
 
void InitializeByImageAndBinsizeAndMaximum (const Image *image, double maximum, double binsize)
 Initialize from an image with specified maximum and bin size; minimum is computed. More...
 
void InitializeByImageRegionAndBinsize (const Image *image, const Image *mask, double binsize)
 Initialize from masked image region using a specified bin size. More...
 
void InitializeByImageRegionAndBinsizeAndMinimum (const Image *image, const Image *mask, double minimum, double binsize)
 Initialize from masked image region with specified minimum and bin size; maximum is computed. More...
 
void InitializeByImageRegionAndBinsizeAndMaximum (const Image *image, const Image *mask, double maximum, double binsize)
 Initialize from masked image region with specified maximum and bin size; minimum is computed. More...
 
unsigned int IntensityToIndex (double intensity)
 Map a continuous intensity value to a histogram bin index. More...
 
double IndexToMinimumIntensity (unsigned int index)
 Get the lower bound intensity of a histogram bin. More...
 
double IndexToMeanIntensity (unsigned int index)
 Get the center intensity of a histogram bin. More...
 
double IndexToMaximumIntensity (unsigned int index)
 Get the upper bound intensity of a histogram bin. More...
 
virtual bool GetInitialized () const
 Get whether the quantifier has been initialized. More...
 
virtual unsigned int GetBins () const
 Get the number of histogram bins. More...
 
virtual double GetBinsize () const
 Get the bin size (width of each bin). More...
 
virtual double GetMinimum () const
 Get the minimum intensity of the histogram range. More...
 
virtual double GetMaximum () const
 Get the maximum intensity of the histogram range. More...
 
void SetRequestedRegionToLargestPossibleRegion () override
 Set the RequestedRegion to the LargestPossibleRegion. More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Determine whether the RequestedRegion is outside of the BufferedRegion. More...
 
bool VerifyRequestedRegion () override
 Verify that the RequestedRegion is within the LargestPossibleRegion. More...
 
void SetRequestedRegion (const itk::DataObject *) override
 Set the requested region from this data object to match the requested region of the data object passed in as a parameter. More...
 
bool IsEmpty () const override
 Check whether the object contains data at any time step. More...
 
- Public Member Functions inherited from mitk::BaseData
 mitkClassMacroItkParent (BaseData, itk::DataObject)
 
BaseProperty::ConstPointer GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override
 Get a const property by its key. More...
 
std::vector< std::string > GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override
 Get all property keys stored in the property list. More...
 
std::vector< std::string > GetPropertyContextNames () const override
 Get the names of all property contexts. More...
 
BaseProperty * GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override
 Get a non-const property by its key. More...
 
void SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Set a property in the property list. More...
 
void RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Remove a property from the property list. More...
 
const mitk::TimeGeometry * GetTimeGeometry () const
 Return the TimeGeometry of the data as const pointer. More...
 
mitk::TimeGeometry * GetTimeGeometry ()
 Return the TimeGeometry of the data as non-const pointer. More...
 
const mitk::TimeGeometry * GetUpdatedTimeGeometry ()
 Return the TimeGeometry of the data after ensuring it is up-to-date. More...
 
virtual void Expand (unsigned int timeSteps)
 Expand the TimeGeometry to a number of time steps. More...
 
const mitk::BaseGeometry * GetUpdatedGeometry (int t=0)
 Return the BaseGeometry of the data at time step t after ensuring it is up-to-date. More...
 
mitk::BaseGeometry * GetGeometry (int t=0) const
 Return the BaseGeometry of the data at time step t as a non-const pointer. More...
 
void UpdateOutputInformation () override
 Update the information for this BaseData so that it can be used as an output of a BaseProcess. More...
 
void CopyInformation (const itk::DataObject *data) override
 Copy information from the specified data set. More...
 
virtual bool IsInitialized () const
 Check whether the data has been initialized. More...
 
virtual void Clear ()
 Reset the data object by calling ClearData() and InitializeEmpty(). More...
 
virtual bool IsEmptyTimeStep (unsigned int t) const
 Check whether the object contains data at the specified time step. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an operation on this data object. More...
 
virtual void SetGeometry (BaseGeometry *aGeometry3D)
 Set the BaseGeometry of the data, which will be referenced (not copied!). More...
 
virtual void SetTimeGeometry (TimeGeometry *geometry)
 Set the TimeGeometry of the data, which will be referenced (not copied!). More...
 
virtual void SetClonedGeometry (const BaseGeometry *aGeometry3D)
 Set a clone of the provided geometry as the BaseGeometry of the data. More...
 
virtual void SetClonedTimeGeometry (const TimeGeometry *geometry)
 Set a clone of the provided TimeGeometry as the TimeGeometry of the data. More...
 
virtual void SetClonedGeometry (const BaseGeometry *aGeometry3D, unsigned int time)
 Set a clone of the provided geometry as the BaseGeometry of a given time step. More...
 
mitk::PropertyList::Pointer GetPropertyList () const
 Get the data's property list. More...
 
void SetPropertyList (PropertyList *propertyList)
 Set the data's property list, replacing the existing one. More...
 
mitk::BaseProperty::Pointer GetProperty (const char *propertyKey) const
 Get a property by its key from the PropertyList. More...
 
void SetProperty (const char *propertyKey, BaseProperty *property)
 Set a property in the PropertyList. More...
 
virtual void SetOrigin (const Point3D &origin)
 Convenience method for setting the origin of the BaseGeometry instances of all time steps. More...
 
itk::SmartPointer< mitk::BaseDataSource > GetSource () const
 Get the process object that generated this data object. More...
 
unsigned int GetTimeSteps () const
 Get the number of time steps from the TimeGeometry. More...
 
itk::ModifiedTimeType GetMTime () const override
 Get the modification time of this data object or its geometry, whichever was modified most recently. More...
 
void Graft (const DataObject *) override
 Graft data and information from another data object. More...
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 
- Public Member Functions inherited from mitk::Identifiable
 Identifiable ()
 Default constructor. Generates a new random UID. More...
 
 Identifiable (const UIDType &uid)
 Construct with a pre-existing UID. More...
 
 Identifiable (const Identifiable &)=delete
 Copy construction is deleted to prevent UID duplication. More...
 
 Identifiable (Identifiable &&) noexcept
 Move constructor. Transfers ownership of the UID. More...
 
virtual ~Identifiable ()
 Virtual destructor. More...
 
Identifiable & operator= (const Identifiable &)=delete
 Copy assignment is deleted to prevent UID duplication. More...
 
Identifiable & operator= (Identifiable &&other) noexcept
 Move assignment operator. Transfers ownership of the UID. More...
 
virtual UIDType GetUID () const
 Get the unique identifier of this object. More...
 
UIDType GetRuntimeUID () const noexcept
 Get a runtime-unique ID for this object instance. More...
 
- Public Member Functions inherited from mitk::IPropertyOwner
 ~IPropertyOwner () override
 
virtual bool PropertyIsOwned (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const
 Checks if a certain property exists. More...
 
- Public Member Functions inherited from mitk::IPropertyProvider
virtual ~IPropertyProvider ()
 Virtual destructor. More...
 

Static Public Member Functions

static Pointer New ()
 

Additional Inherited Members

- Public Types inherited from mitk::Identifiable
using UIDType = std::string
 Type alias for unique identifiers. More...
 
- Protected Member Functions inherited from mitk::BaseData
 BaseData ()
 
 BaseData (const BaseData &other)
 
 ~BaseData () override
 
virtual void InitializeTimeGeometry (unsigned int timeSteps=1)
 Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More...
 
virtual void ClearData ()
 reset to non-initialized state, release memory More...
 
virtual void InitializeEmpty ()
 Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least create one empty object and call Superclass::InitializeTimeGeometry() to ensure an existing valid geometry. More...
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
- Protected Member Functions inherited from mitk::Identifiable
virtual void SetUID (const UIDType &uid)
 
- Protected Attributes inherited from mitk::BaseData
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion
 
unsigned int m_SourceOutputIndexDuplicate
 
bool m_Initialized
 

Detailed Description

Maps continuous image intensity values to discrete histogram bin indices.

IntensityQuantifier provides various initialization strategies for setting up an intensity-to-bin-index mapping. Initialization can be done by explicitly providing minimum, maximum, bin count, and/or bin size, or by computing these from an image (optionally restricted to a masked region).

After initialization, IntensityToIndex() maps a continuous intensity value to a zero-based bin index, and the IndexTo*Intensity() methods perform the reverse mapping.

See also
AbstractGlobalImageFeature

Definition at line 38 of file mitkIntensityQuantifier.h.

Constructor & Destructor Documentation

◆ IntensityQuantifier()

mitk::IntensityQuantifier::IntensityQuantifier ( )

Member Function Documentation

◆ Clone()

Pointer mitk::IntensityQuantifier::Clone ( ) const

◆ GetBins()

virtual unsigned int mitk::IntensityQuantifier::GetBins ( ) const
virtual

Get the number of histogram bins.

◆ GetBinsize()

virtual double mitk::IntensityQuantifier::GetBinsize ( ) const
virtual

Get the bin size (width of each bin).

◆ GetInitialized()

virtual bool mitk::IntensityQuantifier::GetInitialized ( ) const
virtual

Get whether the quantifier has been initialized.

◆ GetMaximum()

virtual double mitk::IntensityQuantifier::GetMaximum ( ) const
virtual

Get the maximum intensity of the histogram range.

◆ GetMinimum()

virtual double mitk::IntensityQuantifier::GetMinimum ( ) const
virtual

Get the minimum intensity of the histogram range.

◆ IndexToMaximumIntensity()

double mitk::IntensityQuantifier::IndexToMaximumIntensity ( unsigned int  index)

Get the upper bound intensity of a histogram bin.

Parameters
[in]indexZero-based bin index.
Returns
The maximum intensity value for the given bin.

◆ IndexToMeanIntensity()

double mitk::IntensityQuantifier::IndexToMeanIntensity ( unsigned int  index)

Get the center intensity of a histogram bin.

Parameters
[in]indexZero-based bin index.
Returns
The mean intensity value for the given bin.

◆ IndexToMinimumIntensity()

double mitk::IntensityQuantifier::IndexToMinimumIntensity ( unsigned int  index)

Get the lower bound intensity of a histogram bin.

Parameters
[in]indexZero-based bin index.
Returns
The minimum intensity value for the given bin.

◆ InitializeByBinsizeAndBins()

void mitk::IntensityQuantifier::InitializeByBinsizeAndBins ( double  minimum,
unsigned int  bins,
double  binsize 
)

Initialize with explicit minimum, number of bins, and bin size.

Maximum is computed as minimum + bins * binsize.

Parameters
[in]minimumThe lower bound of the intensity range.
[in]binsNumber of histogram bins.
[in]binsizeWidth of each bin.

◆ InitializeByBinsizeAndMaximum()

void mitk::IntensityQuantifier::InitializeByBinsizeAndMaximum ( double  minimum,
double  maximum,
double  binsize 
)

Initialize with explicit minimum, maximum, and bin size.

The number of bins is computed as ceil((maximum - minimum) / binsize). The actual maximum may be adjusted to be an exact multiple of binsize.

Parameters
[in]minimumThe lower bound of the intensity range.
[in]maximumThe upper bound of the intensity range.
[in]binsizeWidth of each bin.

◆ InitializeByImage()

void mitk::IntensityQuantifier::InitializeByImage ( const Image *  image,
unsigned int  bins 
)

Initialize from the full intensity range of an image.

Parameters
[in]imageThe image from which to determine minimum and maximum intensities.
[in]binsNumber of histogram bins.

◆ InitializeByImageAndBinsize()

void mitk::IntensityQuantifier::InitializeByImageAndBinsize ( const Image *  image,
double  binsize 
)

Initialize from the full image intensity range using a specified bin size.

Parameters
[in]imageThe image from which to determine minimum and maximum intensities.
[in]binsizeWidth of each bin.

◆ InitializeByImageAndBinsizeAndMaximum()

void mitk::IntensityQuantifier::InitializeByImageAndBinsizeAndMaximum ( const Image *  image,
double  maximum,
double  binsize 
)

Initialize from an image with specified maximum and bin size; minimum is computed.

Parameters
[in]imageThe image from which to determine the minimum intensity.
[in]maximumThe upper bound of the intensity range.
[in]binsizeWidth of each bin.

◆ InitializeByImageAndBinsizeAndMinimum()

void mitk::IntensityQuantifier::InitializeByImageAndBinsizeAndMinimum ( const Image *  image,
double  minimum,
double  binsize 
)

Initialize from an image with specified minimum and bin size; maximum is computed.

Parameters
[in]imageThe image from which to determine the maximum intensity.
[in]minimumThe lower bound of the intensity range.
[in]binsizeWidth of each bin.

◆ InitializeByImageAndMaximum()

void mitk::IntensityQuantifier::InitializeByImageAndMaximum ( const Image *  image,
double  maximum,
unsigned int  bins 
)

Initialize from an image with a specified maximum; minimum is computed from the image.

Parameters
[in]imageThe image from which to determine the minimum intensity.
[in]maximumThe upper bound of the intensity range.
[in]binsNumber of histogram bins.

◆ InitializeByImageAndMinimum()

void mitk::IntensityQuantifier::InitializeByImageAndMinimum ( const Image *  image,
double  minimum,
unsigned int  bins 
)

Initialize from an image with a specified minimum; maximum is computed from the image.

Parameters
[in]imageThe image from which to determine the maximum intensity.
[in]minimumThe lower bound of the intensity range.
[in]binsNumber of histogram bins.

◆ InitializeByImageRegion()

void mitk::IntensityQuantifier::InitializeByImageRegion ( const Image *  image,
const Image *  mask,
unsigned int  bins 
)

Initialize from the intensity range of masked voxels in an image.

Parameters
[in]imageThe image from which to determine intensities.
[in]maskBinary mask; only voxels with mask value > 0 are considered.
[in]binsNumber of histogram bins.

◆ InitializeByImageRegionAndBinsize()

void mitk::IntensityQuantifier::InitializeByImageRegionAndBinsize ( const Image *  image,
const Image *  mask,
double  binsize 
)

Initialize from masked image region using a specified bin size.

Parameters
[in]imageThe image from which to determine intensities.
[in]maskBinary mask; only voxels with mask value > 0 are considered.
[in]binsizeWidth of each bin.

◆ InitializeByImageRegionAndBinsizeAndMaximum()

void mitk::IntensityQuantifier::InitializeByImageRegionAndBinsizeAndMaximum ( const Image *  image,
const Image *  mask,
double  maximum,
double  binsize 
)

Initialize from masked image region with specified maximum and bin size; minimum is computed.

Parameters
[in]imageThe image from which to determine intensities.
[in]maskBinary mask; only voxels with mask value > 0 are considered.
[in]maximumThe upper bound of the intensity range.
[in]binsizeWidth of each bin.

◆ InitializeByImageRegionAndBinsizeAndMinimum()

void mitk::IntensityQuantifier::InitializeByImageRegionAndBinsizeAndMinimum ( const Image *  image,
const Image *  mask,
double  minimum,
double  binsize 
)

Initialize from masked image region with specified minimum and bin size; maximum is computed.

Parameters
[in]imageThe image from which to determine intensities.
[in]maskBinary mask; only voxels with mask value > 0 are considered.
[in]minimumThe lower bound of the intensity range.
[in]binsizeWidth of each bin.

◆ InitializeByImageRegionAndMaximum()

void mitk::IntensityQuantifier::InitializeByImageRegionAndMaximum ( const Image *  image,
const Image *  mask,
double  maximum,
unsigned int  bins 
)

Initialize from masked image region with a specified maximum; minimum is computed.

Parameters
[in]imageThe image from which to determine intensities.
[in]maskBinary mask; only voxels with mask value > 0 are considered.
[in]maximumThe upper bound of the intensity range.
[in]binsNumber of histogram bins.

◆ InitializeByImageRegionAndMinimum()

void mitk::IntensityQuantifier::InitializeByImageRegionAndMinimum ( const Image *  image,
const Image *  mask,
double  minimum,
unsigned int  bins 
)

Initialize from masked image region with a specified minimum; maximum is computed.

Parameters
[in]imageThe image from which to determine intensities.
[in]maskBinary mask; only voxels with mask value > 0 are considered.
[in]minimumThe lower bound of the intensity range.
[in]binsNumber of histogram bins.

◆ InitializeByMinimumMaximum()

void mitk::IntensityQuantifier::InitializeByMinimumMaximum ( double  minimum,
double  maximum,
unsigned int  bins 
)

Initialize with explicit minimum, maximum, and number of bins.

The bin size is computed as (maximum - minimum) / bins.

Parameters
[in]minimumThe lower bound of the intensity range.
[in]maximumThe upper bound of the intensity range.
[in]binsNumber of histogram bins.

◆ IntensityToIndex()

unsigned int mitk::IntensityQuantifier::IntensityToIndex ( double  intensity)

Map a continuous intensity value to a histogram bin index.

The index is clamped to [0, Bins-1].

Parameters
[in]intensityThe intensity value to quantize.
Returns
Zero-based bin index.
Precondition
The quantifier must be initialized.

◆ IsEmpty()

bool mitk::IntensityQuantifier::IsEmpty ( ) const
inlineoverridevirtual

Check whether the object contains data at any time step.

Iterates over all time steps and returns true only if every time step is empty (or the object is not initialized).

Warning
Returns IsInitialized()==false by default for compatibility reasons. Override in sub-classes that support distinction between empty/non-empty state.
Returns
True if the data object is empty at all time steps.
See also
IsEmptyTimeStep

Reimplemented from mitk::BaseData.

Definition at line 247 of file mitkIntensityQuantifier.h.

◆ mitkClassMacro()

mitk::IntensityQuantifier::mitkClassMacro ( IntensityQuantifier  ,
BaseData   
)

◆ New()

static Pointer mitk::IntensityQuantifier::New ( )
static

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::IntensityQuantifier::RequestedRegionIsOutsideOfTheBufferedRegion ( )
inlineoverridevirtual

Determine whether the RequestedRegion is outside of the BufferedRegion.

This method returns true if the RequestedRegion is outside the BufferedRegion (true if at least one pixel is outside). This is used by the pipeline mechanism to determine whether a filter needs to re-execute in order to satisfy the current request. If the current RequestedRegion is already inside the BufferedRegion from the previous execution (and the current filter is up to date), then a given filter does not need to re-execute.

Returns
True if the requested region is outside the buffered region.

Implements mitk::BaseData.

Definition at line 242 of file mitkIntensityQuantifier.h.

◆ SetRequestedRegion()

void mitk::IntensityQuantifier::SetRequestedRegion ( const itk::DataObject *  data)
inlineoverridevirtual

Set the requested region from this data object to match the requested region of the data object passed in as a parameter.

This method is implemented in the concrete subclasses of BaseData.

Parameters
[in]dataThe data object whose requested region will be matched.

Implements mitk::BaseData.

Definition at line 244 of file mitkIntensityQuantifier.h.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::IntensityQuantifier::SetRequestedRegionToLargestPossibleRegion ( )
inlineoverridevirtual

Set the RequestedRegion to the LargestPossibleRegion.

This forces a filter to produce all of the output in one execution (i.e., not streaming) on the next call to Update().

Implements mitk::BaseData.

Definition at line 241 of file mitkIntensityQuantifier.h.

◆ VerifyRequestedRegion()

bool mitk::IntensityQuantifier::VerifyRequestedRegion ( )
inlineoverridevirtual

Verify that the RequestedRegion is within the LargestPossibleRegion.

If the RequestedRegion is not within the LargestPossibleRegion, then the filter cannot possibly satisfy the request. This method returns true if the request can be satisfied (even if it will be necessary to process the entire LargestPossibleRegion) and returns false otherwise. Used by PropagateRequestedRegion(), which throws an InvalidRequestedRegionError exception if the requested region is not within the LargestPossibleRegion.

Returns
True if the requested region is within the largest possible region.

Implements mitk::BaseData.

Definition at line 243 of file mitkIntensityQuantifier.h.


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