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

itkWeightedCovarianceCalculator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkWeightedCovarianceCalculator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/21 05:41:18 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) 2002 Insight 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 #ifndef __itkWeightedCovarianceCalculator_h
00018 #define __itkWeightedCovarianceCalculator_h
00019 
00020 #include "itkVector.h"
00021 #include "itkMatrix.h"
00022 #include "itkSampleAlgorithmBase.h"
00023 
00024 namespace itk{ 
00025 namespace Statistics{
00026   
00034 template< class TSample >
00035 class WeightedCovarianceCalculator :
00036       public SampleAlgorithmBase< TSample >
00037 {
00038 public:
00040   typedef WeightedCovarianceCalculator Self;
00041   typedef SampleAlgorithmBase< TSample > Superclass ;
00042   typedef SmartPointer<Self> Pointer;
00043 
00045   itkTypeMacro(WeightedCovarianceCalculator, SampleAlgorithmBase);
00046   itkNewMacro(Self) ;
00047 
00048   itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00049                       TSample::MeasurementVectorSize);
00050 
00052   typedef typename TSample::MeasurementVectorType MeasurementVectorType ;
00053   
00055   typedef FunctionBase< MeasurementVectorType, double > WeightFunctionType ;
00056 
00058   typedef Matrix< double,
00059                   itkGetStaticConstMacro(MeasurementVectorSize),
00060                   itkGetStaticConstMacro(MeasurementVectorSize) > 
00061           OutputType ;
00062 
00064   typedef Vector< double, itkGetStaticConstMacro(MeasurementVectorSize) >
00065           MeanType ;
00066 
00068   typedef Array< double > WeightArrayType ;
00069 
00071   void SetWeights(WeightArrayType* array) ;
00072 
00074   WeightArrayType* GetWeights() ;
00075 
00079   void SetWeightFunction(WeightFunctionType* func) ;
00080 
00082   WeightFunctionType* GetWeightFunction() ;
00083   
00085   void SetMean(MeanType* mean)
00086   {
00087     if ( m_Mean != mean )
00088       {
00089         m_Mean = mean ;
00090         this->Modified() ;
00091       }
00092   }
00093 
00095   void GetMean()
00096   { return m_Mean ; }
00097 
00099   OutputType* GetOutput() ;
00100 
00101 protected:
00102   WeightedCovarianceCalculator() ;
00103   virtual ~WeightedCovarianceCalculator() ;
00104   void PrintSelf(std::ostream& os, Indent indent) const;
00105 
00107   void GenerateData() ;
00108 
00109 private:
00110   OutputType* m_Output ;
00111   MeanType* m_Mean ;
00112   WeightArrayType* m_Weights ;
00113   WeightFunctionType* m_WeightFunction ;
00114 } ; // end of class
00115     
00116   } // end of namespace Statistics 
00117 } // end of namespace itk 
00118 
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkWeightedCovarianceCalculator.txx"
00121 #endif
00122 
00123 #endif
00124 

Generated at Fri May 21 01:15:44 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000