Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::Statistics::CovarianceCalculator< TSample > Class Template Reference

Calculates the covariance matrix of the target sample data. More...

#include <itkCovarianceCalculator.h>

Inheritance diagram for itk::Statistics::CovarianceCalculator< TSample >:

Inheritance graph
[legend]
Collaboration diagram for itk::Statistics::CovarianceCalculator< TSample >:

Collaboration graph
[legend]
List of all members.

[NOHEADER]

virtual const char * GetNameOfClass () const
Pointer New ()

Public Types

typedef CovarianceCalculator Self
typedef SampleAlgorithmBase<
TSample > 
Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const
Self
ConstPointer
typedef Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
typedef Superclass::MeasurementVectorType MeasurementVectorType
typedef Array< double > MeanType
typedef VariableSizeMatrix<
double > 
OutputType

Public Member Functions

void SetMean (MeanType *mean)
MeanTypeGetMean ()
const OutputTypeGetOutput () const

Protected Member Functions

 CovarianceCalculator ()
virtual ~CovarianceCalculator ()
void PrintSelf (std::ostream &os, Indent indent) const
void GenerateData ()
void ComputeCovarianceWithGivenMean ()
void ComputeCovarianceWithoutGivenMean ()

Detailed Description

template<class TSample>
class itk::Statistics::CovarianceCalculator< TSample >

Calculates the covariance matrix of the target sample data.

If there is a mean vector provided by the SetMean method, this calculator will do the caculation as follows: Let $\Sigma$ denotes covariance matrix for the sample, then: When $x_{i}$ is $i$th component of a measurement vector $\vec x$, $\mu_{i}$ is the $i$th componet of the $\vec\mu$, and the $\sigma_{ij}$ is the $ij$th componet $\Sigma$, $\sigma_{ij} = (x_{i} - \mu_{i})(x_{j} - \mu_{j})$

Without the plugged in mean vector, this calculator will perform the single pass mean and covariance calculation algorithm.

Recent API changes: The static const macro to get the length of a measurement vector, 'MeasurementVectorSize' has been removed to allow the length of a measurement vector to be specified at run time. It is now obtained from the input sample. Please use the function GetMeasurementVectorSize() to obtain the length. The mean output is an Array rather than a Vector. The covariance matrix is represented by a VariableSizeMatrix rather than a Matrix.

Definition at line 53 of file itkCovarianceCalculator.h.


Member Typedef Documentation

template<class TSample>
typedef SmartPointer<const Self> itk::Statistics::CovarianceCalculator< TSample >::ConstPointer
 

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

Definition at line 61 of file itkCovarianceCalculator.h.

template<class TSample>
typedef Array< double > itk::Statistics::CovarianceCalculator< TSample >::MeanType
 

Typedef for the mean output

Definition at line 75 of file itkCovarianceCalculator.h.

template<class TSample>
typedef Superclass::MeasurementVectorSizeType itk::Statistics::CovarianceCalculator< TSample >::MeasurementVectorSizeType
 

Length of a measurement vector

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

Definition at line 69 of file itkCovarianceCalculator.h.

template<class TSample>
typedef Superclass::MeasurementVectorType itk::Statistics::CovarianceCalculator< TSample >::MeasurementVectorType
 

Measurement vector type

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

Definition at line 72 of file itkCovarianceCalculator.h.

template<class TSample>
typedef VariableSizeMatrix< double > itk::Statistics::CovarianceCalculator< TSample >::OutputType
 

Typedef for Covariance output

Definition at line 78 of file itkCovarianceCalculator.h.

template<class TSample>
typedef SmartPointer<Self> itk::Statistics::CovarianceCalculator< TSample >::Pointer
 

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

Definition at line 60 of file itkCovarianceCalculator.h.

template<class TSample>
typedef CovarianceCalculator itk::Statistics::CovarianceCalculator< TSample >::Self
 

Standard class typedefs.

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

Definition at line 58 of file itkCovarianceCalculator.h.

template<class TSample>
typedef SampleAlgorithmBase< TSample > itk::Statistics::CovarianceCalculator< TSample >::Superclass
 

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

Definition at line 59 of file itkCovarianceCalculator.h.


Constructor & Destructor Documentation

template<class TSample>
itk::Statistics::CovarianceCalculator< TSample >::CovarianceCalculator  )  [protected]
 

template<class TSample>
virtual itk::Statistics::CovarianceCalculator< TSample >::~CovarianceCalculator  )  [protected, virtual]
 


Member Function Documentation

template<class TSample>
void itk::Statistics::CovarianceCalculator< TSample >::ComputeCovarianceWithGivenMean  )  [protected]
 

Calculates the covariance matrix using the given mean

template<class TSample>
void itk::Statistics::CovarianceCalculator< TSample >::ComputeCovarianceWithoutGivenMean  )  [protected]
 

Calculates the covariance matrix and the mean in a single pass

template<class TSample>
void itk::Statistics::CovarianceCalculator< TSample >::GenerateData  )  [protected, virtual]
 

Calculates the covariance and save it. This method calls ComputeCovarianceWithGivenMean, if the user provides mean vector using SetMean method. Otherwise, it calls ComputeCovarianceWithoutGivenMethod depending on

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

template<class TSample>
MeanType* itk::Statistics::CovarianceCalculator< TSample >::GetMean  ) 
 

Returns the sample pointer

template<class TSample>
virtual const char* itk::Statistics::CovarianceCalculator< TSample >::GetNameOfClass  )  const [virtual]
 

Standard Macros

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

template<class TSample>
const OutputType* itk::Statistics::CovarianceCalculator< TSample >::GetOutput  )  const
 

Returns the covariance matrix of the target sample data

template<class TSample>
Pointer itk::Statistics::CovarianceCalculator< TSample >::New  )  [static]
 

Standard Macros

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

template<class TSample>
void itk::Statistics::CovarianceCalculator< TSample >::PrintSelf std::ostream &  os,
Indent  indent
const [protected, virtual]
 

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Statistics::SampleAlgorithmBase< TSample >.

template<class TSample>
void itk::Statistics::CovarianceCalculator< TSample >::SetMean MeanType mean  ) 
 

Stores the sample pointer


The documentation for this class was generated from the following file:
Generated at Thu May 25 03:03:31 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000