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

Container class for storing a StatisticsObject for each time step. More...

#include <mitkImageStatisticsContainer.h>

Inheritance diagram for mitk::ImageStatisticsContainer:
Collaboration diagram for mitk::ImageStatisticsContainer:

Classes

class  ImageStatisticsObject
 Container class for storing the computed image statistics. More...
 

Public Types

using HistogramType = itk::Statistics::Histogram< double >
 
using LabelValueType = MultiLabelSegmentation::LabelValueType
 
using StatisticsVariantType = ImageStatisticsObject::StatisticsVariantType
 
using RealType = ImageStatisticsObject::RealType
 
using IndexType = ImageStatisticsObject::IndexType
 
using VoxelCountType = ImageStatisticsObject::VoxelCountType
 
using TimeStepVectorType = std::vector< TimeStepType >
 Vector of time step indices. More...
 
using LabelValueVectorType = MultiLabelSegmentation::LabelValueVectorType
 
- Public Types inherited from mitk::Identifiable
using UIDType = std::string
 Type alias for unique identifiers. More...
 

Public Member Functions

 mitkClassMacro (ImageStatisticsContainer, mitk::BaseData)
 
Pointer Clone () const
 
void SetRequestedRegionToLargestPossibleRegion () override
 Required by BaseData. Sets requested region to largest possible. No-op. More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Required by BaseData. Always returns false (data is always buffered). More...
 
bool VerifyRequestedRegion () override
 Required by BaseData. Always returns true. More...
 
void SetRequestedRegion (const itk::DataObject *) override
 Required by BaseData. No-op for this container. More...
 
TimeStepVectorType GetExistingTimeSteps (LabelValueType labelValue) const
 Get all time steps for which statistics exist for the given label. More...
 
LabelValueVectorType GetExistingLabelValues () const
 Get all label values for which statistics have been stored. More...
 
void Reset ()
 Delete all stored statistics for all labels and time steps. More...
 
const ImageStatisticsObject & GetStatistics (LabelValueType labelValue, TimeStepType timeStep) const
 Retrieve the statistics object for a given label and time step. More...
 
void SetStatistics (LabelValueType labelValue, TimeStepType timeStep, const ImageStatisticsObject &statistics)
 Sets the statisticObject for the given Timestep. More...
 
bool StatisticsExist (LabelValueType labelValue, TimeStepType timeStep) const
 Checks if the Time step exists. More...
 
const HistogramType * GetHistogram (LabelValueType labelValue, TimeStepType timeStep) const
 
bool IgnoresZeroVoxel () const
 Check whether this container was computed with zero-voxel ignoring enabled. More...
 
bool IsWIP () const
 Check whether this container is a work-in-progress placeholder. 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...
 
virtual bool IsEmpty () const
 Check whether the object contains data at any 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 ()
 

Static Public Attributes

static constexpr LabelValueType NO_MASK_LABEL_VALUE
 Label value used to query statistics when no mask was provided. More...
 

Protected Member Functions

 ImageStatisticsContainer ()
 
 ImageStatisticsContainer (const ImageStatisticsContainer &other)
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 mitkCloneMacro (Self)
 
- 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)
 

Additional Inherited Members

- Protected Attributes inherited from mitk::BaseData
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion
 
unsigned int m_SourceOutputIndexDuplicate
 
bool m_Initialized
 

Detailed Description

Container class for storing a StatisticsObject for each time step.

Stored statistics are:

  • for the defined statistics, see GetAllStatisticNames
  • Histogram of Pixel Values

Definition at line 34 of file mitkImageStatisticsContainer.h.

Member Typedef Documentation

◆ HistogramType

using mitk::ImageStatisticsContainer::HistogramType = itk::Statistics::Histogram<double>

Definition at line 41 of file mitkImageStatisticsContainer.h.

◆ IndexType

◆ LabelValueType

◆ LabelValueVectorType

◆ RealType

◆ StatisticsVariantType

◆ TimeStepVectorType

Vector of time step indices.

Definition at line 147 of file mitkImageStatisticsContainer.h.

◆ VoxelCountType

Constructor & Destructor Documentation

◆ ImageStatisticsContainer() [1/2]

mitk::ImageStatisticsContainer::ImageStatisticsContainer ( )
protected

◆ ImageStatisticsContainer() [2/2]

mitk::ImageStatisticsContainer::ImageStatisticsContainer ( const ImageStatisticsContainer &  other)
protected

Member Function Documentation

◆ Clone()

Pointer mitk::ImageStatisticsContainer::Clone ( ) const

◆ GetExistingLabelValues()

LabelValueVectorType mitk::ImageStatisticsContainer::GetExistingLabelValues ( ) const

Get all label values for which statistics have been stored.

Returns
Vector of label values.

◆ GetExistingTimeSteps()

TimeStepVectorType mitk::ImageStatisticsContainer::GetExistingTimeSteps ( LabelValueType  labelValue) const

Get all time steps for which statistics exist for the given label.

Parameters
[in]labelValueThe label value to query.
Returns
Vector of time step indices that have stored statistics.

◆ GetHistogram()

const HistogramType* mitk::ImageStatisticsContainer::GetHistogram ( LabelValueType  labelValue,
TimeStepType  timeStep 
) const

/brief Returns the histogram of the passed time step.

Precondition
timeStep must be valid

◆ GetStatistics()

const ImageStatisticsObject& mitk::ImageStatisticsContainer::GetStatistics ( LabelValueType  labelValue,
TimeStepType  timeStep 
) const

Retrieve the statistics object for a given label and time step.

Parameters
[in]labelValueThe label value to query.
[in]timeStepThe time step to query.
Returns
Const reference to the ImageStatisticsObject.
Exceptions
ifno statistics exist for the given label and time step.

◆ IgnoresZeroVoxel()

bool mitk::ImageStatisticsContainer::IgnoresZeroVoxel ( ) const

Check whether this container was computed with zero-voxel ignoring enabled.

Returns
True if zero-valued voxels were excluded during computation.

◆ IsWIP()

bool mitk::ImageStatisticsContainer::IsWIP ( ) const

Check whether this container is a work-in-progress placeholder.

Returns
True if the statistics are still being computed.

◆ mitkClassMacro()

mitk::ImageStatisticsContainer::mitkClassMacro ( ImageStatisticsContainer  ,
mitk::BaseData   
)

◆ mitkCloneMacro()

mitk::ImageStatisticsContainer::mitkCloneMacro ( Self  )
protected

◆ New()

static Pointer mitk::ImageStatisticsContainer::New ( )
static

◆ PrintSelf()

void mitk::ImageStatisticsContainer::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::ImageStatisticsContainer::RequestedRegionIsOutsideOfTheBufferedRegion ( )
inlineoverridevirtual

Required by BaseData. Always returns false (data is always buffered).

Implements mitk::BaseData.

Definition at line 48 of file mitkImageStatisticsContainer.h.

◆ Reset()

void mitk::ImageStatisticsContainer::Reset ( )

Delete all stored statistics for all labels and time steps.

◆ SetRequestedRegion()

void mitk::ImageStatisticsContainer::SetRequestedRegion ( const itk::DataObject *  )
inlineoverridevirtual

Required by BaseData. No-op for this container.

Implements mitk::BaseData.

Definition at line 54 of file mitkImageStatisticsContainer.h.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::ImageStatisticsContainer::SetRequestedRegionToLargestPossibleRegion ( )
inlineoverridevirtual

Required by BaseData. Sets requested region to largest possible. No-op.

Implements mitk::BaseData.

Definition at line 45 of file mitkImageStatisticsContainer.h.

◆ SetStatistics()

void mitk::ImageStatisticsContainer::SetStatistics ( LabelValueType  labelValue,
TimeStepType  timeStep,
const ImageStatisticsObject &  statistics 
)

Sets the statisticObject for the given Timestep.

Precondition
timeStep must be valid

◆ StatisticsExist()

bool mitk::ImageStatisticsContainer::StatisticsExist ( LabelValueType  labelValue,
TimeStepType  timeStep 
) const

Checks if the Time step exists.

Precondition
timeStep must be valid

◆ VerifyRequestedRegion()

bool mitk::ImageStatisticsContainer::VerifyRequestedRegion ( )
inlineoverridevirtual

Required by BaseData. Always returns true.

Implements mitk::BaseData.

Definition at line 51 of file mitkImageStatisticsContainer.h.

Member Data Documentation

◆ NO_MASK_LABEL_VALUE

constexpr LabelValueType mitk::ImageStatisticsContainer::NO_MASK_LABEL_VALUE
staticconstexpr

Label value used to query statistics when no mask was provided.

Definition at line 157 of file mitkImageStatisticsContainer.h.


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