12 #ifndef mitkImageStatisticsHolder_h
13 #define mitkImageStatisticsHolder_h
19 #ifndef __itkHistogram_h
20 #include <itkHistogram.h>
98 if (t < m_ScalarMin.size())
99 return m_ScalarMin[t];
101 return itk::NumericTraits<ScalarType>::max();
113 if (t < m_Scalar2ndMin.size())
114 return m_Scalar2ndMin[t];
116 return itk::NumericTraits<ScalarType>::max();
138 if (t < m_ScalarMax.size())
139 return m_ScalarMax[t];
141 return itk::NumericTraits<ScalarType>::NonpositiveMin();
152 if (t < m_Scalar2ndMax.size())
153 return m_Scalar2ndMax[t];
155 return itk::NumericTraits<ScalarType>::NonpositiveMin();
184 if (t < m_CountOfMaxValuedVoxels.size())
185 return m_CountOfMaxValuedVoxels[t];
198 if (t < m_CountOfMinValuedVoxels.size())
199 return m_CountOfMinValuedVoxels[t];
212 template <
typename ItkImageType>
217 template <
typename ItkImageType>
221 unsigned int component);
240 virtual void Expand(
unsigned int timeSteps);
Class holding the statistics information about a single mitk::Image.
std::vector< ScalarType > m_ScalarMax
virtual unsigned int GetCountOfMinValuedVoxelsNoRecompute(unsigned int t=0) const
Get the count of voxels with the smallest scalar value without triggering recomputation.
virtual mitk::ScalarType GetScalarValue2ndMaxNoRecompute(unsigned int t=0)
Get the second largest scalar value without triggering recomputation.
std::vector< ScalarType > m_Scalar2ndMax
virtual mitk::ScalarType GetScalarValue2ndMinNoRecompute(unsigned int t=0) const
Get the second smallest scalar value without triggering recomputation.
virtual mitk::ScalarType GetScalarValueMinNoRecompute(unsigned int t=0) const
Get the smallest scalar value without triggering recomputation.
std::vector< ScalarType > m_Scalar2ndMin
virtual void ComputeImageStatistics(int t=0, unsigned int component=0)
Compute image statistics for the specified time step and component.
itk::TimeStamp m_LastRecomputeTimeStamp
virtual ScalarType GetScalarValueMin(int t=0, unsigned int component=0)
Get the minimum scalar value. Recomputation performed only when necessary.
itk::Statistics::Histogram< double > HistogramType
virtual ScalarType GetScalarValueMax(int t=0, unsigned int component=0)
Get the maximum scalar value. Recomputation performed only when necessary.
ImageTimeSelector::Pointer GetTimeSelector()
Get an ImageTimeSelector configured with the associated image as input.
itk::Object::Pointer m_TimeSelectorForExtremaObject
std::vector< ScalarType > m_ScalarMin
std::vector< unsigned int > m_CountOfMaxValuedVoxels
virtual unsigned int GetCountOfMaxValuedVoxelsNoRecompute(unsigned int t=0)
Get the count of voxels with the largest scalar value without triggering recomputation.
itk::Object::Pointer m_HistogramGeneratorObject
friend void _ComputeExtremaInItkImage(const ItkImageType *itkImage, mitk::ImageStatisticsHolder *statisticsHolder, int t)
ImageStatisticsHolder(mitk::Image *image)
Constructor.
mitk::ScalarType GetCountOfMinValuedVoxels(int t=0, unsigned int component=0)
Get the count of voxels with the smallest scalar value. Recomputation performed only when necessary.
mitk::ScalarType GetCountOfMaxValuedVoxels(int t=0, unsigned int component=0)
Get the count of voxels with the largest scalar value. Recomputation performed only when necessary.
virtual void Expand(unsigned int timeSteps)
Expand internal statistics storage to accommodate the given number of time steps.
virtual mitk::ScalarType GetScalarValueMaxNoRecompute(unsigned int t=0)
Get the largest scalar value without triggering recomputation.
friend void _ComputeExtremaInItkVectorImage(const ItkImageType *itkImage, mitk::ImageStatisticsHolder *statisticsHolder, int t, unsigned int component)
bool IsValidTimeStep(int t) const
Check whether the given time step is valid for the associated image.
virtual ~ImageStatisticsHolder()
Destructor.
std::vector< unsigned int > m_CountOfMinValuedVoxels
virtual ScalarType GetScalarValue2ndMax(int t=0, unsigned int component=0)
Get the second largest scalar value. Recomputation performed only when necessary.
virtual const HistogramType * GetScalarHistogram(int t=0, unsigned int=0)
Get the scalar histogram for the specified time step.
virtual void ResetImageStatistics()
Reset all cached statistics values to their initial state.
virtual ScalarType GetScalarValue2ndMin(int t=0, unsigned int component=0)
Get the second smallest scalar value. Recomputation performed only when necessary.
Image class for storing multi-dimensional medical image data.
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.