18 #ifndef itkHistogram_h
19 #define itkHistogram_h
75 template<
typename TMeasurement = float,
76 typename TFrequencyContainer = DenseFrequencyContainer2 >
78 public Sample< Array< TMeasurement > >
135 void Initialize(
const SizeType & size);
159 itkGetConstMacro(ClipBinsAtEnds,
bool);
163 itkSetMacro(ClipBinsAtEnds,
bool);
167 bool IsIndexOutOfBounds(
const IndexType & index)
const;
196 void SetBinMax(
unsigned int dimension,
242 bool SetFrequencyOfIndex(
const IndexType & index,
258 bool IncreaseFrequencyOfIndex(
const IndexType & index,
268 bool IncreaseFrequencyOfMeasurement(
283 unsigned int dimension)
const;
290 unsigned int dimension)
const;
307 double Quantile(
unsigned int dimension,
double p)
const;
311 double Mean(
unsigned int dimension)
const;
317 void PrintSelf(std::ostream & os,
Indent indent)
const override;
334 m_Histogram = histogram;
352 return m_Histogram->GetFrequency(m_Id);
362 return m_Histogram->GetMeasurementVector(m_Id);
367 return m_Histogram->GetIndex(m_Id);
378 return ( m_Id != it.
m_Id );
383 return ( m_Id == it.
m_Id );
389 m_Id(id), m_Histogram(histogram)
421 this->ConstIterator::operator=(it);
427 auto * histogram =
const_cast< Self *
>( this->m_Histogram );
429 return histogram->SetFrequency(this->m_Id, value);
451 return Iterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
463 return ConstIterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
477 unsigned int m_NumberOfInstances{0};
484 std::vector< std::vector< MeasurementType > >
m_Min;
487 std::vector< std::vector< MeasurementType > >
m_Max;
492 bool m_ClipBinsAtEnds{
true};
497 #ifndef ITK_MANUAL_INSTANTIATION
498 #include "itkHistogram.hxx"
Array class with size defined at construction time.
Iterator(Self *histogram)
ConstIterator(InstanceIdentifier id, const Self *histogram)
std::vector< InstanceIdentifier > OffsetTableType
ConstIterator End() const
ConstIterator(const ConstIterator &it)
class that walks through the elements of the histogram.
TFrequencyContainer FrequencyContainerType
::itk::IndexValueType ValueType
This class stores measurement vectors in the context of n-dimensional histogram.
std::vector< BinMinVectorType > BinMinContainerType
ConstIterator & operator++()
bool SetFrequency(const AbsoluteFrequencyType value)
void Initialize() override
typename FrequencyContainerType::TotalRelativeFrequencyType TotalRelativeFrequencyType
const MeasurementVectorType & GetMeasurementVector() const
typename FrequencyContainerType::Pointer FrequencyContainerPointer
std::vector< std::vector< MeasurementType > > m_Max
std::vector< std::vector< MeasurementType > > m_Min
const IndexType & GetIndex() const
TMeasurement MeasurementType
OffsetTableType m_OffsetTable
ConstIterator & operator=(const ConstIterator &it)
Iterator(InstanceIdentifier id, Self *histogram)
typename FrequencyContainerType::RelativeFrequencyType RelativeFrequencyType
typename SizeType::ValueType SizeValueType
Iterator(const Iterator &it)
MeasurementVectorType ValueType
Represent a n-dimensional size (bounds) of a n-dimensional image.
TMeasurementVector MeasurementVectorType
ConstIterator Begin() const
Iterator & operator=(const Iterator &it)
std::vector< MeasurementType > BinMaxVectorType
bool operator==(const ConstIterator &it)
typename FrequencyContainerType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
MeasurementVectorType m_TempMeasurementVector
FrequencyContainerPointer m_FrequencyContainer
typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
class that walks through the elements of the histogram.
A collection of measurements for statistical analysis.
Control indentation during Print() invocation.
typename Superclass::MeasurementVectorType MeasurementVectorType
typename IndexType::ValueType IndexValueType
Base class for most ITK classes.
typename Superclass::InstanceIdentifier InstanceIdentifier
typename FrequencyContainerType::AbsoluteFrequencyType AbsoluteFrequencyType
std::vector< MeasurementType > BinMinVectorType
Base class for all data objects in ITK.
bool operator!=(const ConstIterator &it)
AbsoluteFrequencyType GetFrequency() const
InstanceIdentifier GetInstanceIdentifier() const
std::vector< BinMaxVectorType > BinMaxContainerType
ConstIterator(const Self *histogram)