18#ifndef itkLabelStatisticsImageFilter_h
19#define itkLabelStatisticsImageFilter_h
27#include <unordered_map>
62template <
typename TInputImage,
typename TLabelImage>
83 using SizeType =
typename TInputImage::SizeType;
140 for (
unsigned int i = 0; i < imageDimension * 2; i += 2)
167 for (
unsigned int i = 0; i < imageDimension * 2; i += 2)
225 friend std::ostream &
243 os <<
"BoundingBox: " << labelStatistics.
m_BoundingBox << std::endl;
252 os <<
"nullptr" << std::endl;
271 using MapType = std::unordered_map<LabelPixelType, LabelStatistics>;
280 itkSetMacro(UseHistograms,
bool);
281 itkGetConstMacro(UseHistograms,
bool);
282 itkBooleanMacro(UseHistograms);
423#ifndef ITK_MANUAL_INSTANTIATION
424# include "itkLabelStatisticsImageFilter.hxx"
void SetSize(SizeValueType sz)
SmartPointer< Self > Pointer
virtual void AllocateOutputs()
virtual void SetNumberOfStreamDivisions(unsigned int _arg)
virtual unsigned int GetNumberOfStreamDivisions() const
Control indentation during Print() invocation.
HistogramType::Pointer m_Histogram
LabelStatistics(LabelStatistics &&)=default
LabelStatistics(const LabelStatistics &l)
LabelStatistics(int size, RealType lowerBound, RealType upperBound)
BoundingBoxType m_BoundingBox
LabelStatistics & operator=(const LabelStatistics &l)
typename DataObject::Pointer DataObjectPointer
void SetNumberOfStreamDivisions(const unsigned int n) override
~LabelStatisticsImageFilter() override=default
HistogramPointer GetHistogram(LabelPixelType label) const
RealType GetMean(LabelPixelType label) const
unsigned int GetNumberOfStreamDivisions() const override
LabelStatisticsImageFilter Self
IdentifierType MapSizeType
typename TLabelImage::RegionType LabelRegionType
typename MapType::iterator MapIterator
itk::Statistics::Histogram< RealType > HistogramType
typename HistogramType::Pointer HistogramPointer
SmartPointer< Self > Pointer
typename TInputImage::IndexType IndexType
SimpleDataObjectDecorator< RealType > RealObjectType
TLabelImage LabelImageType
RealType GetSigma(LabelPixelType label) const
BoundingBoxType GetBoundingBox(LabelPixelType label) const
void MergeMap(MapType &, MapType &) const
MapSizeType GetCount(LabelPixelType label) const
typename TLabelImage::Pointer LabelImagePointer
RealType GetMinimum(LabelPixelType label) const
typename TInputImage::RegionType RegionType
RegionType GetRegion(LabelPixelType label) const
bool HasLabel(LabelPixelType label) const
typename TLabelImage::PixelType LabelPixelType
itkSetInputMacro(LabelInput, TLabelImage)
ImageSink< TInputImage > Superclass
MapSizeType GetNumberOfObjects() const
std::vector< IndexValueType > BoundingBoxType
ValidLabelValuesContainerType m_ValidLabelValues
void AfterStreamedGenerateData() override
LabelStatisticsImageFilter()
MapSizeType GetNumberOfLabels() const
HistogramType::SizeType m_NumBins
std::vector< LabelPixelType > ValidLabelValuesContainerType
typename TLabelImage::IndexType LabelIndexType
itkGetInputMacro(LabelInput, TLabelImage)
static constexpr unsigned int ImageDimension
typename TLabelImage::SizeType LabelSizeType
RealType GetSum(LabelPixelType label) const
typename TInputImage::PixelType PixelType
RealType GetMaximum(LabelPixelType label) const
typename TInputImage::Pointer InputImagePointer
std::unordered_map< LabelPixelType, LabelStatistics > MapType
virtual const ValidLabelValuesContainerType & GetValidLabelValues() const
SmartPointer< const Self > ConstPointer
void BeforeStreamedGenerateData() override
typename TInputImage::SizeType SizeType
void PrintSelf(std::ostream &os, Indent indent) const override
RealType GetMedian(LabelPixelType label) const
typename NumericTraits< PixelType >::RealType RealType
void SetHistogramParameters(const int numBins, RealType lowerBound, RealType upperBound)
typename MapType::const_iterator MapConstIterator
void ThreadedStreamedGenerateData(const RegionType &) override
RealType GetVariance(LabelPixelType label) const
MapType m_LabelStatistics
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
This class stores measurement vectors in the context of n-dimensional histogram.
Array< itk::SizeValueType > SizeType
ArrayType MeasurementVectorType
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType