18 #ifndef __itkHistogram_h
19 #define __itkHistogram_h
75 template<
class TMeasurement = float,
76 class 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,
268 bool IncreaseFrequencyOfMeasurement(
271 #ifdef ITKV3_COMPATIBILITY
275 bool IncreaseFrequency(
const IndexType & index,
278 return IncreaseFrequencyOfIndex(index,value);
282 bool IncreaseFrequency(
283 const MeasurementVectorType & measurement,
284 AbsoluteFrequencyType value)
286 return IncreaseFrequencyOfMeasurement(measurement,value);
294 const MeasurementVectorType & GetMeasurementVector(InstanceIdentifier
id)
const;
297 const MeasurementVectorType & GetMeasurementVector(
const IndexType & index)
const;
301 MeasurementType GetMeasurement(InstanceIdentifier n,
302 unsigned int dimension)
const;
305 TotalAbsoluteFrequencyType GetTotalFrequency()
const;
308 AbsoluteFrequencyType GetFrequency(InstanceIdentifier n,
309 unsigned int dimension)
const;
326 double Quantile(
unsigned int dimension,
double p)
const;
330 double Mean(
unsigned int dimension)
const;
336 void PrintSelf(std::ostream & os,
Indent indent)
const;
353 m_Histogram = histogram;
371 return m_Histogram->GetFrequency(m_Id);
381 return m_Histogram->GetMeasurementVector(m_Id);
386 return m_Histogram->GetIndex(m_Id);
397 return ( m_Id != it.
m_Id );
402 return ( m_Id == it.
m_Id );
410 m_Id(id), m_Histogram(histogram)
440 this->ConstIterator::operator=(it);
446 Self *histogram =
const_cast< Self *
>( this->m_Histogram );
448 return histogram->SetFrequency(this->m_Id, value);
472 return Iterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
484 return ConstIterator(m_OffsetTable[this->GetMeasurementVectorSize()],
this);
496 void operator=(
const Self &);
508 std::vector< std::vector< MeasurementType > >
m_Min;
511 std::vector< std::vector< MeasurementType > >
m_Max;
521 #ifndef ITK_MANUAL_INSTANTIATION
522 #include "itkHistogram.hxx"