Public Member Functions | Protected Attributes | List of all members
mirtk::Histogram1D< HistogramType > Class Template Reference

#include <Histogram1D.h>

Inheritance diagram for mirtk::Histogram1D< HistogramType >:
Inheritance graph
Collaboration diagram for mirtk::Histogram1D< HistogramType >:
Collaboration graph

Public Member Functions

void Add (int, HistogramType=1)
 Add counts to bin.
 
void AddSample (double, HistogramType=1)
 Add sample to bin.
 
double BinToCDF (int bin) const
 Convert bin into cumulative density distributions.
 
double BinToPDF (int bin) const
 Convert bin into probability density distributions.
 
double BinToVal (int bin) const
 Convert bin index to sample value.
 
int CDFToBin (double p) const
 Convert cumulative density distributions to bin value.
 
double CDFToVal (double p) const
 Convert cumulative density distributions to sample value.
 
void Delete (int, HistogramType=1)
 Delete counts from bin.
 
void DelSample (double, HistogramType=1)
 Delete sample from bin.
 
double Entropy () const
 Calculate entropy.
 
double GetMax () const
 Get maximum value in histogram.
 
double GetMin () const
 Get minimum value in histogram.
 
double GetWidth () const
 Get width of bins in histogram.
 
 Histogram1D (const Histogram1D &)
 Construct a histogram from another histogram.
 
 Histogram1D (int nbins=256)
 Construct a histogram with 256 bins and samples ranging from 0 to 255.
 
 Histogram1D (double min, double max, double width)
 Construct a histogram for samples ranging from min to max and width.
 
 Histogram1D (const char *)
 Read constructor.
 
void Log ()
 Log transform histogram.
 
double Max () const
 Get maximum value in histogram.
 
void Max (double)
 
double Mean () const
 Calculate mean.
 
double Min () const
 Get minimum value in histogram.
 
void Min (double)
 
double Mode () const
 Return smallest modal value.
 
Array< double > Modes () const
 Return sorted modal values.
 
int NumberOfBins () const
 Get number of bins in histogram.
 
void NumberOfBins (int)
 
HistogramType NumberOfSamples () const
 Get number of samples in histogram.
 
void NumberOfSamples (HistogramType)
 Set number of samples in histogram.
 
HistogramType & operator() (int)
 Get number of samples in bin(i)
 
const HistogramType & operator() (int) const
 Get number of samples in bin(i)
 
Histogram1Doperator= (const Histogram1D &)
 Assignment operator.
 
void Print () const
 Print histogram.
 
void PutMax (double)
 Put maximum value in histogram.
 
void PutMin (double)
 Put minimum value in histogram.
 
void PutNumberOfBins (int)
 Put number of bins in histogram.
 
void PutWidth (double)
 Put width of bins in histogram.
 
HistogramType * RawPointer ()
 Get raw pointer to histogram bins.
 
const HistogramType * RawPointer () const
 Get raw pointer to histogram bins.
 
void Read (const char *)
 Read histogram.
 
void Reset ()
 Clear and reset histogram.
 
void Smooth ()
 Smooth histogram.
 
double StandardDeviation () const
 Calculate standard deviation.
 
int ValToBin (double val) const
 Convert sample value to bin index.
 
double ValToCDF (double val) const
 Convert sample value into cumulative density distributions.
 
double ValToPDF (double val) const
 Convert sample value into probability density distributions.
 
double ValToRange (double val) const
 Convert sample value to continuous bin index.
 
double Variance () const
 Calculate variance.
 
void Write (const char *) const
 Wrirte histogram.
 
 ~Histogram1D ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Protected Attributes

HistogramType * _bins
 Dynamic memory for bins.
 
double _max
 Max. value for samples, everything below is ignored.
 
double _min
 Min. value for samples, everything below is ignored.
 
int _nbins
 Number of bins.
 
HistogramType _nsamp
 Number of samples.
 
double _width
 Width of bins.
 

Additional Inherited Members

- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

template<class HistogramType>
class mirtk::Histogram1D< HistogramType >

Class for 1D histograms.

Definition at line 35 of file Histogram1D.h.

Member Function Documentation

§ Max()

template<class HistogramType >
void mirtk::Histogram1D< HistogramType >::Max ( double  max)
inline

Set maximum value in histogram

Note
Unlike PutMax, this function does not reset the histogram.

Definition at line 284 of file Histogram1D.h.

§ Min()

template<class HistogramType >
void mirtk::Histogram1D< HistogramType >::Min ( double  min)
inline

Set minimum value in histogram

Note
Unlike PutMin, this function does not reset the histogram.

Definition at line 262 of file Histogram1D.h.

§ NumberOfBins()

template<class HistogramType >
void mirtk::Histogram1D< HistogramType >::NumberOfBins ( int  nbins)
inline

Put number of bins in histogram

Note
Unlike PutNumberOfBins, this function does not reset the histogram.

Definition at line 242 of file Histogram1D.h.


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