 |
ITK
5.4.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkHistogram_h
19 #define itkHistogram_h
76 template <
typename TMeasurement =
float,
typename TFrequencyContainer = DenseFrequencyContainer2>
101 using typename Superclass::MeasurementVectorType;
102 using typename Superclass::InstanceIdentifier;
103 using typename Superclass::MeasurementVectorSizeType;
161 itkGetConstMacro(ClipBinsAtEnds,
bool);
165 itkSetMacro(ClipBinsAtEnds,
bool);
170 IsIndexOutOfBounds(
const IndexType & index)
const;
176 GetInstanceIdentifier(
const IndexType & index)
const;
180 Size()
const override;
188 GetSize(
unsigned int dimension)
const;
209 GetBinMinFromValue(
unsigned int dimension,
float value)
const;
214 GetBinMaxFromValue(
unsigned int dimension,
float value)
const;
218 GetDimensionMins(
unsigned int dimension)
const;
222 GetDimensionMaxs(
unsigned int dimension)
const;
234 GetHistogramMinFromIndex(
const IndexType & index)
const;
238 GetHistogramMaxFromIndex(
const IndexType & index)
const;
246 GetFrequency(
const IndexType & index)
const;
297 GetMeasurementVector(
const IndexType & index)
const;
306 GetTotalFrequency()
const override;
328 Quantile(
unsigned int dimension,
double p)
const;
333 Mean(
unsigned int dimension)
const;
341 PrintSelf(std::ostream & os,
Indent indent)
const override;
357 m_Histogram = histogram;
377 return m_Histogram->GetFrequency(m_Id);
389 return m_Histogram->GetMeasurementVector(m_Id);
395 return m_Histogram->GetIndex(m_Id);
408 return (m_Id == it.
m_Id);
416 , m_Histogram(histogram)
460 this->ConstIterator::operator=(it);
467 auto * histogram = const_cast<Self *>(this->m_Histogram);
469 return histogram->SetFrequency(this->m_Id, value);
484 return Iterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
498 return ConstIterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
512 unsigned int m_NumberOfInstances{ 0 };
521 std::vector<std::vector<MeasurementType>> m_Min{};
524 std::vector<std::vector<MeasurementType>> m_Max{};
529 bool m_ClipBinsAtEnds{
true };
534 #ifndef ITK_MANUAL_INSTANTIATION
535 # include "itkHistogram.hxx"
class that walks through the elements of the histogram.
Iterator & operator=(const Iterator &it)
InstanceIdentifier GetInstanceIdentifier() const
SmartPointer< Self > Pointer
typename FrequencyContainerType::Pointer FrequencyContainerPointer
Iterator(const Iterator &it)
ConstIterator(const Self *histogram)
Represent a n-dimensional size (bounds) of a n-dimensional image.
void Initialize() override
std::vector< MeasurementType > BinMinVectorType
ConstIterator & operator++()
ConstIterator Begin() const
Control indentation during Print() invocation.
typename MeasurementVectorTraits::InstanceIdentifier InstanceIdentifier
std::vector< BinMaxVectorType > BinMaxContainerType
This class stores measurement vectors in the context of n-dimensional histogram.
bool operator==(const ConstIterator &it) const
std::vector< BinMinVectorType > BinMinContainerType
typename FrequencyContainerType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
typename FrequencyContainerType::RelativeFrequencyType RelativeFrequencyType
typename SizeType::ValueType SizeValueType
typename FrequencyContainerType::AbsoluteFrequencyType AbsoluteFrequencyType
Iterator(Self *histogram)
ConstIterator & operator=(const ConstIterator &it)
std::vector< MeasurementType > BinMaxVectorType
typename FrequencyContainerType::TotalRelativeFrequencyType TotalRelativeFrequencyType
std::vector< InstanceIdentifier > OffsetTableType
itk::IndexValueType ValueType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
AbsoluteFrequencyType GetFrequency() const
typename IndexType::ValueType IndexValueType
Array class with size defined at construction time.
TFrequencyContainer FrequencyContainerType
A collection of measurements for statistical analysis.
Base class for most ITK classes.
const MeasurementVectorType & GetMeasurementVector() const
Iterator(InstanceIdentifier id, Self *histogram)
const IndexType & GetIndex() const
TMeasurement MeasurementType
class that walks through the elements of the histogram.
ConstIterator End() const
ConstIterator(InstanceIdentifier id, const Self *histogram)
ConstIterator(const ConstIterator &it)
bool SetFrequency(const AbsoluteFrequencyType value)
Base class for all data objects in ITK.