Medical Imaging Interaction Toolkit  2018.4.99-ef453c4b
Medical Imaging Interaction Toolkit
mitk::ImageStatisticsHolder Class Reference

Class holding the statistics informations about a single mitk::Image. More...

#include <mitkImageStatisticsHolder.h>

Collaboration diagram for mitk::ImageStatisticsHolder:

Public Types

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

Public Member Functions

 ImageStatisticsHolder (mitk::Image *image)
 
virtual ~ImageStatisticsHolder ()
 
virtual const HistogramTypeGetScalarHistogram (int t=0, unsigned int=0)
 
virtual ScalarType GetScalarValueMin (int t=0, unsigned int component=0)
 Get the minimum for scalar images. Recomputation performed only when necessary. More...
 
virtual ScalarType GetScalarValueMax (int t=0, unsigned int component=0)
 Get the maximum for scalar images. Recomputation performed only when necessary. More...
 
virtual ScalarType GetScalarValue2ndMin (int t=0, unsigned int component=0)
 Get the second smallest value for scalar images. Recomputation performed only when necessary. More...
 
virtual mitk::ScalarType GetScalarValueMinNoRecompute (unsigned int t=0) const
 Get the smallest value for scalar images, but do not recompute it first. More...
 
virtual mitk::ScalarType GetScalarValue2ndMinNoRecompute (unsigned int t=0) const
 Get the second smallest value for scalar images, but do not recompute it first. More...
 
virtual ScalarType GetScalarValue2ndMax (int t=0, unsigned int component=0)
 Get the second largest value for scalar images. More...
 
virtual mitk::ScalarType GetScalarValueMaxNoRecompute (unsigned int t=0)
 Get the largest value for scalar images, but do not recompute it first. More...
 
virtual mitk::ScalarType GetScalarValue2ndMaxNoRecompute (unsigned int t=0)
 Get the second largest value for scalar images, but do not recompute it first. More...
 
mitk::ScalarType GetCountOfMinValuedVoxels (int t=0, unsigned int component=0)
 Get the count of voxels with the smallest scalar value in the dataset. More...
 
mitk::ScalarType GetCountOfMaxValuedVoxels (int t=0, unsigned int component=0)
 Get the count of voxels with the largest scalar value in the dataset. More...
 
virtual unsigned int GetCountOfMaxValuedVoxelsNoRecompute (unsigned int t=0)
 Get the count of voxels with the largest scalar value in the dataset. More...
 
virtual unsigned int GetCountOfMinValuedVoxelsNoRecompute (unsigned int t=0) const
 Get the count of voxels with the smallest scalar value in the dataset. More...
 
bool IsValidTimeStep (int t) const
 

Protected Member Functions

virtual void ResetImageStatistics ()
 
virtual void ComputeImageStatistics (int t=0, unsigned int component=0)
 
virtual void Expand (unsigned int timeSteps)
 
ImageTimeSelector::Pointer GetTimeSelector ()
 

Protected Attributes

mitk::Imagem_Image
 
itk::Object::Pointer m_HistogramGeneratorObject
 
itk::Object::Pointer m_TimeSelectorForExtremaObject
 
std::vector< unsigned int > m_CountOfMinValuedVoxels
 
std::vector< unsigned int > m_CountOfMaxValuedVoxels
 
std::vector< ScalarTypem_ScalarMin
 
std::vector< ScalarTypem_ScalarMax
 
std::vector< ScalarTypem_Scalar2ndMin
 
std::vector< ScalarTypem_Scalar2ndMax
 
itk::TimeStamp m_LastRecomputeTimeStamp
 

Friends

template<typename ItkImageType >
void _ComputeExtremaInItkImage (const ItkImageType *itkImage, mitk::ImageStatisticsHolder *statisticsHolder, int t)
 
template<typename ItkImageType >
void _ComputeExtremaInItkVectorImage (const ItkImageType *itkImage, mitk::ImageStatisticsHolder *statisticsHolder, int t, unsigned int component)
 

Detailed Description

Class holding the statistics informations about a single mitk::Image.

This computation was previously directly included in the definition and implementation of the mitk::Image class but for having a clear interface, all statistics computation is moved to the ImageStatisticsHolder class.

Each mitk::Image holds a normal pointer to its StatisticsHolder object. To get access to the methods, use the GetStatistics() method in mitk::Image class.

Minimum or maximum might by infinite values. 2nd minimum and maximum are guaranteed to be finite values.

Definition at line 36 of file mitkImageStatisticsHolder.h.

Member Typedef Documentation

◆ HistogramType

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

Definition at line 45 of file mitkImageStatisticsHolder.h.

Constructor & Destructor Documentation

◆ ImageStatisticsHolder()

mitk::ImageStatisticsHolder::ImageStatisticsHolder ( mitk::Image image)

◆ ~ImageStatisticsHolder()

mitk::ImageStatisticsHolder::~ImageStatisticsHolder ( )
virtual

Desctructor

Definition at line 31 of file mitkImageStatisticsHolder.cpp.

References m_HistogramGeneratorObject.

Member Function Documentation

◆ ComputeImageStatistics()

◆ Expand()

void mitk::ImageStatisticsHolder::Expand ( unsigned int  timeSteps)
protectedvirtual

◆ GetCountOfMaxValuedVoxels()

mitk::ScalarType mitk::ImageStatisticsHolder::GetCountOfMaxValuedVoxels ( int  t = 0,
unsigned int  component = 0 
)

Get the count of voxels with the largest scalar value in the dataset.

Definition at line 343 of file mitkImageStatisticsHolder.cpp.

References ComputeImageStatistics(), and m_CountOfMaxValuedVoxels.

Referenced by mitk::Image::GetCountOfMaxValuedVoxels().

◆ GetCountOfMaxValuedVoxelsNoRecompute()

virtual unsigned int mitk::ImageStatisticsHolder::GetCountOfMaxValuedVoxelsNoRecompute ( unsigned int  t = 0)
inlinevirtual

Get the count of voxels with the largest scalar value in the dataset.

Definition at line 120 of file mitkImageStatisticsHolder.h.

Referenced by mitk::Image::GetCountOfMaxValuedVoxelsNoRecompute(), and mitk::LevelWindow::SetAuto().

◆ GetCountOfMinValuedVoxels()

mitk::ScalarType mitk::ImageStatisticsHolder::GetCountOfMinValuedVoxels ( int  t = 0,
unsigned int  component = 0 
)

Get the count of voxels with the smallest scalar value in the dataset.

Definition at line 337 of file mitkImageStatisticsHolder.cpp.

References ComputeImageStatistics(), and m_CountOfMinValuedVoxels.

Referenced by mitk::Image::GetCountOfMinValuedVoxels().

◆ GetCountOfMinValuedVoxelsNoRecompute()

virtual unsigned int mitk::ImageStatisticsHolder::GetCountOfMinValuedVoxelsNoRecompute ( unsigned int  t = 0) const
inlinevirtual

Get the count of voxels with the smallest scalar value in the dataset.

Definition at line 130 of file mitkImageStatisticsHolder.h.

Referenced by mitk::Image::GetCountOfMinValuedVoxelsNoRecompute(), and mitk::LevelWindow::SetAuto().

◆ GetScalarHistogram()

const mitk::ImageStatisticsHolder::HistogramType * mitk::ImageStatisticsHolder::GetScalarHistogram ( int  t = 0,
unsigned  int = 0 
)
virtual

◆ GetScalarValue2ndMax()

mitk::ScalarType mitk::ImageStatisticsHolder::GetScalarValue2ndMax ( int  t = 0,
unsigned int  component = 0 
)
virtual

Get the second largest value for scalar images.

Postcondition
The returned value is always a finite value.

Definition at line 331 of file mitkImageStatisticsHolder.cpp.

References ComputeImageStatistics(), and m_Scalar2ndMax.

Referenced by mitk::Image::GetScalarValue2ndMax().

◆ GetScalarValue2ndMaxNoRecompute()

virtual mitk::ScalarType mitk::ImageStatisticsHolder::GetScalarValue2ndMaxNoRecompute ( unsigned int  t = 0)
inlinevirtual

Get the second largest value for scalar images, but do not recompute it first.

Definition at line 102 of file mitkImageStatisticsHolder.h.

Referenced by mitk::Image::GetScalarValue2ndMaxNoRecompute(), mitk::LevelWindow::SetAuto(), and mitk::LevelWindow::SetToImageRange().

◆ GetScalarValue2ndMin()

mitk::ScalarType mitk::ImageStatisticsHolder::GetScalarValue2ndMin ( int  t = 0,
unsigned int  component = 0 
)
virtual

Get the second smallest value for scalar images. Recomputation performed only when necessary.

Postcondition
The returned value is always a finite value.

Definition at line 325 of file mitkImageStatisticsHolder.cpp.

References ComputeImageStatistics(), and m_Scalar2ndMin.

Referenced by mitk::Image::GetScalarValue2ndMin().

◆ GetScalarValue2ndMinNoRecompute()

virtual mitk::ScalarType mitk::ImageStatisticsHolder::GetScalarValue2ndMinNoRecompute ( unsigned int  t = 0) const
inlinevirtual

Get the second smallest value for scalar images, but do not recompute it first.

Postcondition
The returned value is always a finite value.

Definition at line 76 of file mitkImageStatisticsHolder.h.

References max().

Referenced by mitk::Image::GetScalarValue2ndMinNoRecompute(), mitk::LevelWindow::SetAuto(), and mitk::LevelWindow::SetToImageRange().

◆ GetScalarValueMax()

mitk::ScalarType mitk::ImageStatisticsHolder::GetScalarValueMax ( int  t = 0,
unsigned int  component = 0 
)
virtual

◆ GetScalarValueMaxNoRecompute()

virtual mitk::ScalarType mitk::ImageStatisticsHolder::GetScalarValueMaxNoRecompute ( unsigned int  t = 0)
inlinevirtual

Get the largest value for scalar images, but do not recompute it first.

Postcondition
The returned value is always a finite value.

Definition at line 92 of file mitkImageStatisticsHolder.h.

Referenced by mitk::Image::GetScalarValueMaxNoRecompute(), mitk::LevelWindow::SetAuto(), and mitk::LevelWindow::SetToImageRange().

◆ GetScalarValueMin()

◆ GetScalarValueMinNoRecompute()

virtual mitk::ScalarType mitk::ImageStatisticsHolder::GetScalarValueMinNoRecompute ( unsigned int  t = 0) const
inlinevirtual

Get the smallest value for scalar images, but do not recompute it first.

Definition at line 65 of file mitkImageStatisticsHolder.h.

References max().

Referenced by mitk::Image::GetScalarValueMinNoRecompute().

◆ GetTimeSelector()

mitk::ImageTimeSelector::Pointer mitk::ImageStatisticsHolder::GetTimeSelector ( )
protected

◆ IsValidTimeStep()

bool mitk::ImageStatisticsHolder::IsValidTimeStep ( int  t) const

Definition at line 54 of file mitkImageStatisticsHolder.cpp.

References mitk::Image::IsValidTimeStep(), and m_Image.

Referenced by ResetImageStatistics().

◆ ResetImageStatistics()

void mitk::ImageStatisticsHolder::ResetImageStatistics ( )
protectedvirtual

Friends And Related Function Documentation

◆ _ComputeExtremaInItkImage

template<typename ItkImageType >
void _ComputeExtremaInItkImage ( const ItkImageType *  itkImage,
mitk::ImageStatisticsHolder statisticsHolder,
int  t 
)
friend

Referenced by ComputeImageStatistics().

◆ _ComputeExtremaInItkVectorImage

template<typename ItkImageType >
void _ComputeExtremaInItkVectorImage ( const ItkImageType *  itkImage,
mitk::ImageStatisticsHolder statisticsHolder,
int  t,
unsigned int  component 
)
friend

Referenced by ComputeImageStatistics().

Member Data Documentation

◆ m_CountOfMaxValuedVoxels

std::vector<unsigned int> mitk::ImageStatisticsHolder::m_CountOfMaxValuedVoxels
mutableprotected

◆ m_CountOfMinValuedVoxels

std::vector<unsigned int> mitk::ImageStatisticsHolder::m_CountOfMinValuedVoxels
mutableprotected

◆ m_HistogramGeneratorObject

itk::Object::Pointer mitk::ImageStatisticsHolder::m_HistogramGeneratorObject
mutableprotected

◆ m_Image

mitk::Image* mitk::ImageStatisticsHolder::m_Image
protected

◆ m_LastRecomputeTimeStamp

itk::TimeStamp mitk::ImageStatisticsHolder::m_LastRecomputeTimeStamp
protected

Definition at line 172 of file mitkImageStatisticsHolder.h.

Referenced by ComputeImageStatistics(), and ResetImageStatistics().

◆ m_Scalar2ndMax

std::vector<ScalarType> mitk::ImageStatisticsHolder::m_Scalar2ndMax
mutableprotected

◆ m_Scalar2ndMin

std::vector<ScalarType> mitk::ImageStatisticsHolder::m_Scalar2ndMin
mutableprotected

◆ m_ScalarMax

std::vector<ScalarType> mitk::ImageStatisticsHolder::m_ScalarMax
mutableprotected

◆ m_ScalarMin

std::vector<ScalarType> mitk::ImageStatisticsHolder::m_ScalarMin
mutableprotected

◆ m_TimeSelectorForExtremaObject

itk::Object::Pointer mitk::ImageStatisticsHolder::m_TimeSelectorForExtremaObject
mutableprotected

Definition at line 164 of file mitkImageStatisticsHolder.h.


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