18 #ifndef __itkHistogram_h
19 #define __itkHistogram_h
38 template<
typename THistogram >
85 template<
class TMeasurement = float,
88 public Sample< Array< TMeasurement > >
144 void Initialize(
const SizeType & size);
173 itkGetConstMacro(ClipBinsAtEnds,
bool);
177 itkSetMacro(ClipBinsAtEnds,
bool);
181 bool IsIndexOutOfBounds(
const IndexType & index)
const;
210 void SetBinMax(
unsigned int dimension,
256 bool SetFrequencyOfIndex(
const IndexType & index,
272 bool IncreaseFrequencyOfIndex(
const IndexType & index,
278 bool IncreaseFrequencyOfMeasurement(
281 #ifdef ITKV3_COMPATIBILITY
285 bool IncreaseFrequency(
const IndexType & index,
288 return IncreaseFrequencyOfIndex(index,value);
292 bool IncreaseFrequency(
293 const MeasurementVectorType & measurement,
294 AbsoluteFrequencyType value)
296 return IncreaseFrequencyOfMeasurement(measurement,value);
304 const MeasurementVectorType & GetMeasurementVector(InstanceIdentifier
id)
const;
307 const MeasurementVectorType & GetMeasurementVector(
const IndexType & index)
const;
311 MeasurementType GetMeasurement(InstanceIdentifier n,
312 unsigned int dimension)
const;
315 TotalAbsoluteFrequencyType GetTotalFrequency()
const;
318 AbsoluteFrequencyType GetFrequency(InstanceIdentifier n,
319 unsigned int dimension)
const;
336 double Quantile(
unsigned int dimension,
double p)
const;
340 double Mean(
unsigned int dimension)
const;
346 void PrintSelf(std::ostream & os,
Indent indent)
const;
363 m_Histogram = histogram;
381 return m_Histogram->GetFrequency(m_Id);
391 return m_Histogram->GetMeasurementVector(m_Id);
396 return m_Histogram->GetIndex(m_Id);
407 return ( m_Id != it.
m_Id );
412 return ( m_Id == it.
m_Id );
420 m_Id(id), m_Histogram(histogram)
450 this->ConstIterator::operator=(it);
456 Self *histogram =
const_cast< Self *
>( this->m_Histogram );
458 return histogram->SetFrequency(this->m_Id, value);
482 return Iterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
494 return ConstIterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
505 void operator=(
const Self &);
517 std::vector< std::vector< MeasurementType > >
m_Min;
520 std::vector< std::vector< MeasurementType > >
m_Max;
530 #ifndef ITK_MANUAL_INSTANTIATION
531 #include "itkHistogram.hxx"