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

itkCovarianceCalculator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCovarianceCalculator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/12/15 01:00:46 $
00007   Version:   $Revision: 1.12 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkCovarianceCalculator_h
00019 #define __itkCovarianceCalculator_h
00020 
00021 #include "itkSampleAlgorithmBase.h"
00022 
00023 #include "itkVector.h"
00024 #include "itkMatrix.h"
00025 
00026 namespace itk{ 
00027 namespace Statistics{
00028   
00044 template< class TSample >
00045 class CovarianceCalculator :
00046     public SampleAlgorithmBase< TSample >
00047 {
00048 public:
00050   typedef CovarianceCalculator Self;
00051   typedef Object Superclass ;
00052   typedef SmartPointer<Self> Pointer;
00053   typedef SmartPointer<const Self> ConstPointer;
00054 
00056   itkTypeMacro(CovarianceCalculator, Object);
00057   itkNewMacro(Self) ;
00058   
00059   itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00060                       TSample::MeasurementVectorSize) ;
00061 
00063   typedef Vector< double, itkGetStaticConstMacro(MeasurementVectorSize) > MeanType ;
00064   typedef Matrix< double, itkGetStaticConstMacro(MeasurementVectorSize), itkGetStaticConstMacro(MeasurementVectorSize) > OutputType ;
00065 
00067   void SetMean(MeanType* mean) ;
00068 
00070   MeanType* GetMean() ;
00071 
00073   const OutputType * GetOutput() const;
00074 
00075 protected:
00076   CovarianceCalculator() ;
00077   virtual ~CovarianceCalculator() ;
00078   void PrintSelf(std::ostream& os, Indent indent) const;
00079 
00084   void GenerateData() ;
00085 
00087   void ComputeCovarianceWithGivenMean() ;
00088 
00090   void ComputeCovarianceWithoutGivenMean() ;
00091 
00092 private:
00093   OutputType m_Output ;
00094   MeanType* m_Mean ;
00095   MeanType* m_InternalMean ;
00096 } ; // end of class
00097     
00098 } // end of namespace Statistics 
00099 } // end of namespace itk 
00100 
00101 #ifndef ITK_MANUAL_INSTANTIATION
00102 #include "itkCovarianceCalculator.txx"
00103 #endif
00104 
00105 #endif
00106 

Generated at Tue Mar 29 23:49:22 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000