Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
BIAS::Median1D< DataType > Class Template Reference

Computes the median and p-quantile of a vector. More...

#include <MathAlgo/Median1D.hh>

+ Collaboration diagram for BIAS::Median1D< DataType >:

Public Member Functions

void Compute (const std::vector< DataType > &vec)
 Compute median and store sorted vector internally. More...
 
DataType GetMedian () const
 Return computed median. More...
 
DataType GetQuantile (double p) const
 Compute and return p-quantile of vector. More...
 
DataType GetX84 () const
 Return median of absolute differences to median (X84 rule). More...
 
DataType GetX84 (const std::vector< DataType > &vec, DataType median) const
 Return median of absolute differences to median (X84 rule) for given vector without storing it internally. More...
 
 Median1D ()
 
 Median1D (const std::vector< DataType > &vec)
 Compute median and store sorted vector internally. More...
 
 ~Median1D ()
 

Protected Attributes

DataType Median_
 
std::vector< DataType > Values_
 

Detailed Description

template<class DataType>
class BIAS::Median1D< DataType >

Computes the median and p-quantile of a vector.

   The vectors is stored internally and sorted using std::sort.
   Hence this class should be used only with basic data types.
Note
For even vector sizes, the lower median is computed.
Author
esquivel 11/2013

Definition at line 41 of file Median1D.hh.

Constructor & Destructor Documentation

template<class DataType>
BIAS::Median1D< DataType >::Median1D ( )
inline

Definition at line 45 of file Median1D.hh.

template<class DataType>
BIAS::Median1D< DataType >::~Median1D ( )
inline

Definition at line 47 of file Median1D.hh.

template<class DataType>
BIAS::Median1D< DataType >::Median1D ( const std::vector< DataType > &  vec)
inline

Compute median and store sorted vector internally.

Definition at line 50 of file Median1D.hh.

Member Function Documentation

template<class DataType >
void Median1D::Compute ( const std::vector< DataType > &  vec)
template<class DataType>
DataType BIAS::Median1D< DataType >::GetMedian ( ) const
inline
template<class DataType >
DataType Median1D::GetQuantile ( double  p) const

Compute and return p-quantile of vector.

Definition at line 46 of file Median1D.cpp.

template<class DataType>
DataType BIAS::Median1D< DataType >::GetX84 ( ) const
inline

Return median of absolute differences to median (X84 rule).

Definition at line 62 of file Median1D.hh.

References BIAS::Median1D< DataType >::GetX84().

Referenced by BIAS::Median< InputStorageType, OutputStorageType >::FilterRemoveSaltAndPepper(), and BIAS::Median1D< DataType >::GetX84().

template<class DataType >
DataType Median1D::GetX84 ( const std::vector< DataType > &  vec,
DataType  median 
) const

Return median of absolute differences to median (X84 rule) for given vector without storing it internally.

Definition at line 58 of file Median1D.cpp.

Member Data Documentation

template<class DataType>
DataType BIAS::Median1D< DataType >::Median_
protected

Definition at line 70 of file Median1D.hh.

template<class DataType>
std::vector<DataType> BIAS::Median1D< DataType >::Values_
protected

Definition at line 71 of file Median1D.hh.


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