13 #ifndef mitkSimpleHistogram_h
14 #define mitkSimpleHistogram_h
16 #ifndef __itkHistogram_h
17 #include <itkHistogram.h>
25 #include <itkImageRegionIterator.h>
26 #include <itkImageRegionIteratorWithIndex.h>
114 unsigned int nBins = 256;
151 static const unsigned int maxCacheSize = 64;
197 unsigned int targetSize = full ? 0 : maxCacheSize;
199 while (cache.size() > targetSize)
#define MITKALGORITHMSEXT_EXPORT
Base class of all data objects.
Abstract base element stored in the histogram cache.
mitk::WeakPointer< BaseData > baseData
Weak reference to the source data.
virtual SimpleHistogram * GetHistogram()=0
Get the computed histogram.
itk::TimeStamp m_LastUpdateTime
Timestamp of last computation.
virtual void ComputeFromBaseData(BaseData *baseData)=0
Compute the histogram from the given BaseData.
Cache for SimpleHistogram objects to avoid redundant recomputation.
std::list< Element * > CacheContainer
CacheContainer cache
The list of cached elements.
SimpleHistogram * operator[](BaseData::Pointer sp_BaseData)
Retrieve or compute a histogram for the given BaseData.
void TrimCache(bool full=false)
Abstract base class for simple histograms with double values.
virtual void ComputeFromBaseData(BaseData *source)=0
Compute the histogram from the given BaseData source.
virtual double GetMin() const =0
Returns the minimum value of the histogram.
virtual double GetMax() const =0
Returns the maximum value of the histogram.
virtual float GetRelativeBin(double start, double end) const =0
Get the relative frequency of bins in the range [start, end].
Histogram implementation for mitk::Image data.
void ComputeFromBaseData(BaseData *source) override
Compute the histogram from an image.
HistogramType::ConstPointer histogram
The computed ITK histogram.
double GetMax() const override
Returns the maximum value of the histogram.
bool valid
Whether the histogram is valid.
itk::Image< unsigned char, 3 > BinImage
itk::ImageRegionIterator< CTImage > CTIteratorType
float GetRelativeBin(double start, double end) const override
Get the relative frequency of bins in the range [start, end].
itk::Statistics::Histogram< double > HistogramType
The underlying ITK histogram type.
itk::ImageRegionIteratorWithIndex< BinImage > BinIteratorIndexType
itk::ImageRegionIteratorWithIndex< CTImage > CTIteratorIndexType
double invLogHighest
Inverse log of the highest bin frequency (for normalization).
double GetMin() const override
Returns the minimum value of the histogram.
bool GetValid()
Check whether the histogram has been computed successfully.
itk::Image< short, 3 > CTImage
itk::ImageRegionIterator< BinImage > BinIteratorType
A weak pointer that observes an itk::Object without preventing its deletion.
Find image slices visible on a given plane.