MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes
mds::img::CHistogram< C > Class Template Reference

Quantized histogram having predefined number of bins/columns. More...

#include <mdsHistogram.h>

Inheritance diagram for mds::img::CHistogram< C >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { NO_ITERATOR_IS_DECLARED_FOR_TEMPLATE_PARAMETER = C::ITERATOR_DECLARED }
 Check that C has an iterator declared. More...
typedef int tBin
 Histogram bin type.
typedef C tContainer
 Container type.
typedef C::tConstIterator tContainerIterator
 Container iterator type.
typedef CHistogram< C > tHistogram
 Concrete histogram type.
typedef C::tIterator::tItem tItem
 Container item type.
typedef mds::math::CVector< tBintVector
 Internal histogram representation.

Public Member Functions

 CHistogram (tSize NumOfBins=DEFAULT_NUM_OF_BINS, tItem Min=CTypeTraits< tItem >::getMin(), tItem Max=CTypeTraits< tItem >::getMax())
 Constructor that creates a new empty histogram.
void cumulate ()
 Creates the cumulative histogram.
tBin getCount (tSize Index) const
 Returns value of a given histogram bin.
const tVectorgetHistogram () const
 Returns vector representing the computed histogram.
tHistogramgetImpl ()
 Returns reference to the histogram implementation.
const tHistogramgetImpl () const
tSize getIndex (tItem Value) const
 Computes and returns histogram bin index.
tItem getLowerBound (tSize Index) const
 Returns lower bound of item value of a specified histogram bin.
tBin getMax () const
 Returns maximal histogram value.
tSize getSize () const
 Returns the number of histogram bins.
tBin getTotalCount () const
 Returns sum of all histogram bins.
bool operator() (const tContainer &Container)
 Computes histogram of all container items.
 ~CHistogram ()
 Destructor.

Static Public Attributes

static const int DEFAULT_NUM_OF_BINS = 64
 Default number of bins in the histogram.

Protected Attributes

tItem m_BinSize
 Histogram bin size.
tVector m_Histogram
 Histogram.
tItem m_Max
tItem m_Min
 Minimal and maximal allowed container item value.

Detailed Description

template<typename C>
class mds::img::CHistogram< C >

Quantized histogram having predefined number of bins/columns.


Member Typedef Documentation

template<typename C >
typedef int mds::img::CHistogram< C >::tBin

Histogram bin type.

template<typename C >
typedef C mds::img::CHistogram< C >::tContainer

Container type.

template<typename C >
typedef C::tConstIterator mds::img::CHistogram< C >::tContainerIterator

Container iterator type.

typedef CHistogram< C > mds::img::CHistogramBase< CHistogram< C > >::tHistogram [inherited]

Concrete histogram type.

template<typename C >
typedef C::tIterator::tItem mds::img::CHistogram< C >::tItem

Container item type.

template<typename C >
typedef mds::math::CVector<tBin> mds::img::CHistogram< C >::tVector

Internal histogram representation.


Member Enumeration Documentation

template<typename C >
anonymous enum

Check that C has an iterator declared.

You will see name of this enum somewhere in compiler error message if the type C can't be used with iterators.

Enumerator:
NO_ITERATOR_IS_DECLARED_FOR_TEMPLATE_PARAMETER 

Constructor & Destructor Documentation

template<typename C >
CHistogram::CHistogram ( tSize  NumOfBins = DEFAULT_NUM_OF_BINS,
tItem  Min = CTypeTraits<tItem>::getMin(),
tItem  Max = CTypeTraits<tItem>::getMax() 
)

Constructor that creates a new empty histogram.

  • Parameter Size specifies the number of histogram bins.
  • Min and Max gives range of item values.
template<typename C >
mds::img::CHistogram< C >::~CHistogram ( )

Destructor.


Member Function Documentation

template<typename C >
void CHistogram::cumulate ( )

Creates the cumulative histogram.

template<typename C >
tBin mds::img::CHistogram< C >::getCount ( tSize  Index) const

Returns value of a given histogram bin.

template<typename C >
const tVector& mds::img::CHistogram< C >::getHistogram ( ) const

Returns vector representing the computed histogram.

Returns reference to the histogram implementation.

const tHistogram& mds::img::CHistogramBase< CHistogram< C > >::getImpl ( ) const [inherited]
template<typename C >
tSize mds::img::CHistogram< C >::getIndex ( tItem  Value) const

Computes and returns histogram bin index.

template<typename C >
tItem mds::img::CHistogram< C >::getLowerBound ( tSize  Index) const

Returns lower bound of item value of a specified histogram bin.

template<typename C >
tBin mds::img::CHistogram< C >::getMax ( ) const

Returns maximal histogram value.

template<typename C >
tSize mds::img::CHistogram< C >::getSize ( ) const

Returns the number of histogram bins.

template<typename C >
tBin mds::img::CHistogram< C >::getTotalCount ( ) const

Returns sum of all histogram bins.

template<typename C >
bool CHistogram::operator() ( const tContainer Container)

Computes histogram of all container items.

  • Returns false on failure.

Member Data Documentation

template<typename C >
const int mds::img::CHistogram< C >::DEFAULT_NUM_OF_BINS = 64 [static]

Default number of bins in the histogram.

template<typename C >
tItem mds::img::CHistogram< C >::m_BinSize [protected]

Histogram bin size.

template<typename C >
tVector mds::img::CHistogram< C >::m_Histogram [protected]

Histogram.

template<typename C >
tItem mds::img::CHistogram< C >::m_Max [protected]
template<typename C >
tItem mds::img::CHistogram< C >::m_Min [protected]

Minimal and maximal allowed container item value.


The documentation for this class was generated from the following files: