18 #ifndef itkHistogram_h
19 #define itkHistogram_h
75 template<
typename TMeasurement = float,
76 typename TFrequencyContainer = DenseFrequencyContainer2 >
78 public Sample< Array< TMeasurement > >
134 void Initialize(
const SizeType & size);
163 itkGetConstMacro(ClipBinsAtEnds,
bool);
167 itkSetMacro(ClipBinsAtEnds,
bool);
171 bool IsIndexOutOfBounds(
const IndexType & index)
const;
200 void SetBinMax(
unsigned int dimension,
246 bool SetFrequencyOfIndex(const
IndexType & index,
262 bool IncreaseFrequencyOfIndex(const
IndexType & index,
272 bool IncreaseFrequencyOfMeasurement(
275 #ifdef ITKV3_COMPATIBILITY
279 bool IncreaseFrequency(
const IndexType & index,
282 return IncreaseFrequencyOfIndex(index,value);
286 bool IncreaseFrequency(
287 const MeasurementVectorType & measurement,
288 AbsoluteFrequencyType value)
290 return IncreaseFrequencyOfMeasurement(measurement,value);
298 const MeasurementVectorType & GetMeasurementVector(InstanceIdentifier
id)
const ITK_OVERRIDE;
301 const MeasurementVectorType & GetMeasurementVector(
const IndexType & index)
const;
305 MeasurementType GetMeasurement(InstanceIdentifier n,
306 unsigned int dimension)
const;
309 TotalAbsoluteFrequencyType GetTotalFrequency() const ITK_OVERRIDE;
312 AbsoluteFrequencyType GetFrequency(InstanceIdentifier n,
313 unsigned int dimension) const;
330 double Quantile(
unsigned int dimension,
double p) const;
334 double Mean(
unsigned int dimension) const;
337 virtual
void Graft(const
DataObject *) ITK_OVERRIDE;
340 void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
357 m_Histogram = histogram;
375 return m_Histogram->GetFrequency(m_Id);
385 return m_Histogram->GetMeasurementVector(m_Id);
390 return m_Histogram->GetIndex(m_Id);
401 return ( m_Id != it.
m_Id );
406 return ( m_Id == it.
m_Id );
412 m_Id(id), m_Histogram(histogram)
421 ConstIterator() ITK_DELETED_FUNCTION;
436 ConstIterator(id, histogram)
444 this->ConstIterator::operator=(it);
450 Self *histogram =
const_cast< Self *
>( this->m_Histogram );
452 return histogram->SetFrequency(this->m_Id, value);
461 Iterator(const ConstIterator & it) ITK_DELETED_FUNCTION;
462 ConstIterator & operator=(const ConstIterator & it) ITK_DELETED_FUNCTION;
474 return Iterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
479 ConstIterator iter(0,
this);
486 return ConstIterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
509 std::vector< std::vector< MeasurementType > >
m_Min;
512 std::vector< std::vector< MeasurementType > >
m_Max;
522 #ifndef ITK_MANUAL_INSTANTIATION
523 #include "itkHistogram.hxx"
Sample< ArrayType > Superclass
Array class with size defined at construction time.
IndexType::ValueType IndexValueType
Iterator(Self *histogram)
::itk::IndexValueType ValueType
ConstIterator(InstanceIdentifier id, const Self *histogram)
SmartPointer< Self > Pointer
ConstIterator End() const
ConstIterator(const ConstIterator &it)
Represent the size (bounds) of a n-dimensional image.
class that walks through the elements of the histogram.
Superclass::InstanceIdentifier InstanceIdentifier
virtual ~Histogram() override
std::vector< BinMinVectorType > BinMinContainerType
This class stores measurement vectors in the context of n-dimensional histogram.
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
FrequencyContainerType::AbsoluteFrequencyType AbsoluteFrequencyType
TFrequencyContainer FrequencyContainerType
SmartPointer< const Self > ConstPointer
ConstIterator & operator++()
virtual void Initialize() override
bool SetFrequency(const AbsoluteFrequencyType value)
const MeasurementVectorType & GetMeasurementVector() const
std::vector< MeasurementType > BinMaxVectorType
Array< ::itk::IndexValueType > IndexType
std::vector< std::vector< MeasurementType > > m_Max
std::vector< std::vector< MeasurementType > > m_Min
const IndexType & GetIndex() const
OffsetTableType m_OffsetTable
ConstIterator & operator=(const ConstIterator &it)
FrequencyContainerType::RelativeFrequencyType RelativeFrequencyType
Iterator(InstanceIdentifier id, Self *histogram)
unsigned int m_NumberOfInstances
MeasurementVectorType ValueType
Superclass::MeasurementVectorType MeasurementVectorType
Iterator(const Iterator &it)
std::vector< BinMaxVectorType > BinMaxContainerType
ConstIterator Begin() const
Iterator & operator=(const Iterator &it)
bool operator==(const ConstIterator &it)
TMeasurement MeasurementType
MeasurementVectorType m_TempMeasurementVector
FrequencyContainerPointer m_FrequencyContainer
TMeasurementVector MeasurementVectorType
class that walks through the elements of the histogram.
FrequencyContainerType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
A collection of measurements for statistical analysis.
Control indentation during Print() invocation.
std::vector< MeasurementType > BinMinVectorType
FrequencyContainerType::Pointer FrequencyContainerPointer
Array< ::itk::SizeValueType > SizeType
Base class for all data objects in ITK.
bool operator!=(const ConstIterator &it)
AbsoluteFrequencyType GetFrequency() const
Array< TMeasurement > ArrayType
InstanceIdentifier GetInstanceIdentifier() const
SizeType::ValueType SizeValueType
std::vector< InstanceIdentifier > OffsetTableType
ImageBaseType::IndexType IndexType
ConstIterator(const Self *histogram)
FrequencyContainerType::TotalRelativeFrequencyType TotalRelativeFrequencyType