13 #ifndef mitkLabelStatisticsImageFilter_h
14 #define mitkLabelStatisticsImageFilter_h
18 #include <itkCompensatedSummation.h>
19 #include <itkHistogram.h>
20 #include <itkImageSink.h>
21 #include <itkNumericTraits.h>
22 #include <itkSimpleDataObjectDecorator.h>
25 #include <unordered_map>
48 template <
typename TInputImage>
57 itkFactorylessNewMacro(
Self);
62 using SizeType =
typename TInputImage::SizeType;
69 using RealType =
typename itk::NumericTraits<PixelType>::RealType;
92 itk::CompensatedSummation<RealType>
m_Sum;
110 using MapType = std::unordered_map<LabelPixelType, LabelStatistics>;
132 const std::unordered_map<LabelPixelType, unsigned int>& sizes,
133 const std::unordered_map<LabelPixelType, RealType>& lowerBounds,
134 const std::unordered_map<LabelPixelType, RealType>& upperBounds);
175 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
186 bool m_ComputeHistograms;
187 std::unordered_map<LabelPixelType, unsigned int> m_HistogramSizes;
188 std::unordered_map<LabelPixelType, RealType> m_HistogramLowerBounds;
189 std::unordered_map<LabelPixelType, RealType> m_HistogramUpperBounds;
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include <mitkLabelStatisticsImageFilter.tpp>
BoundingBoxType m_BoundingBox
LabelStatistics(unsigned int size, RealType lowerBound, RealType upperBound)
itk::SizeValueType m_Count
HistogramPointer m_Histogram
itk::CompensatedSummation< RealType > m_Sum
itk::CompensatedSummation< RealType > m_SumOfSquares
itk::CompensatedSummation< RealType > m_SumOfPositivePixels
itk::CompensatedSummation< RealType > m_SumOfQuadruples
itk::CompensatedSummation< RealType > m_SumOfCubes
itk::SizeValueType m_CountOfPositivePixels
Computes per-label image statistics including histogram, moments, and entropy.
void ThreadedStreamedGenerateData(const RegionType &) override
HistogramPointer GetHistogram(LabelPixelType label) const
itk::SizeValueType GetCount(LabelPixelType label) const
static constexpr unsigned int ImageDimension
unsigned int GetNumberOfLabels() const
RealType GetSumOfQuadruples(LabelPixelType label) const
unsigned int GetNumberOfObjects() const
RealType GetMean(LabelPixelType label) const
RealType GetUPP(LabelPixelType label) const
itk::Image< LabelPixelType, ImageDimension > LabelImageType
const ValidLabelValuesContainerType & GetValidLabelValues() const
Get the list of label values that were found during processing.
BoundingBoxType GetBoundingBox(LabelPixelType label) const
typename TInputImage::IndexType IndexType
std::unordered_map< LabelPixelType, LabelStatistics > MapType
typename itk::NumericTraits< PixelType >::RealType RealType
bool HasLabel(LabelPixelType label) const
RegionType GetRegion(LabelPixelType label) const
typename MapType::const_iterator MapConstIterator
typename HistogramType::Pointer HistogramPointer
~LabelStatisticsImageFilter()
RealType GetVariance(LabelPixelType label) const
typename MapType::iterator MapIterator
itk::Statistics::Histogram< RealType > HistogramType
RealType GetMPP(LabelPixelType label) const
RealType GetSumOfCubes(LabelPixelType label) const
itk::ProcessObject ProcessObject
RealType GetEntropy(LabelPixelType label) const
void AfterStreamedGenerateData() override
PixelType GetMaximum(LabelPixelType label) const
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::SimpleDataObjectDecorator< RealType > RealObjectType
itkGetInputMacro(LabelInput, LabelImageType)
RealType GetSum(LabelPixelType label) const
std::vector< LabelPixelType > ValidLabelValuesContainerType
RealType GetKurtosis(LabelPixelType label) const
std::vector< itk::IndexValueType > BoundingBoxType
RealType GetSkewness(LabelPixelType label) const
void BeforeStreamedGenerateData() override
typename itk::DataObject::Pointer DataObjectPointer
itkSetInputMacro(LabelInput, LabelImageType)
itk::ImageSink< TInputImage > Superclass
PixelType GetMinimum(LabelPixelType label) const
RealType GetMedian(LabelPixelType label) const
typename TInputImage::SizeType SizeType
RealType GetSigma(LabelPixelType label) const
typename TInputImage::PixelType PixelType
RealType GetUniformity(LabelPixelType label) const
RealType GetSumOfSquares(LabelPixelType label) const
typename TInputImage::RegionType RegionType
void SetHistogramParameters(const std::unordered_map< LabelPixelType, unsigned int > &sizes, const std::unordered_map< LabelPixelType, RealType > &lowerBounds, const std::unordered_map< LabelPixelType, RealType > &upperBounds)
Set per-label histogram parameters.
typename mitk::Label::PixelType LabelPixelType
LabelStatisticsImageFilter()
unsigned short PixelType
Pixel type used for label values (unsigned short).
Find image slices visible on a given plane.