00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkCovarianceCalculator_h
00019 #define __itkCovarianceCalculator_h
00020
00021 #include "itkSampleAlgorithmBase.h"
00022
00023 #include "itkArray.h"
00024 #include "itkVariableSizeMatrix.h"
00025
00026 namespace itk{
00027 namespace Statistics{
00028
00052 template< class TSample >
00053 class CovarianceCalculator :
00054 public SampleAlgorithmBase< TSample >
00055 {
00056 public:
00058 typedef CovarianceCalculator Self;
00059 typedef SampleAlgorithmBase< TSample > Superclass ;
00060 typedef SmartPointer<Self> Pointer;
00061 typedef SmartPointer<const Self> ConstPointer;
00062
00064 itkTypeMacro(CovarianceCalculator, SampleAlgorithmBase);
00065 itkNewMacro(Self) ;
00067
00069 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
00070
00072 typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
00073
00075 typedef Array< double > MeanType;
00076
00078 typedef VariableSizeMatrix< double > OutputType;
00079
00081 void SetMean(MeanType* mean) ;
00082
00084 MeanType* GetMean() ;
00085
00087 const OutputType * GetOutput() const;
00088
00089 protected:
00090 CovarianceCalculator() ;
00091 virtual ~CovarianceCalculator() ;
00092 void PrintSelf(std::ostream& os, Indent indent) const;
00093
00098 void GenerateData() ;
00099
00101 void ComputeCovarianceWithGivenMean() ;
00102
00104 void ComputeCovarianceWithoutGivenMean() ;
00105
00106 private:
00107 MeanType* m_Mean ;
00108 MeanType* m_InternalMean ;
00109 OutputType m_Output ;
00110 } ;
00111
00112 }
00113 }
00114
00115 #ifndef ITK_MANUAL_INSTANTIATION
00116 #include "itkCovarianceCalculator.txx"
00117 #endif
00118
00119 #endif
00120
00121