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

itkImageGaussianModelEstimator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageGaussianModelEstimator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/03/30 15:13:39 $
00007   Version:   $Revision: 1.11 $
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 #ifndef _itkImageGaussianModelEstimator_h
00018 #define _itkImageGaussianModelEstimator_h
00019 
00020 #include <math.h>
00021 #include <float.h>
00022 
00023 #include "vnl/vnl_vector.h"
00024 #include "vnl/vnl_matrix.h"
00025 #include "vnl/vnl_matrix_fixed.h"
00026 #include "vnl/vnl_math.h"
00027 #include "vnl/algo/vnl_matrix_inverse.h"
00028 
00029 
00030 #include "itkImageRegionIterator.h"
00031 #include "itkExceptionObject.h"
00032 
00033 #include "itkImageModelEstimatorBase.h"
00034 
00035 namespace itk
00036 {
00037 
00078 template <class TInputImage, 
00079           class TMembershipFunction,
00080           class TTrainingImage>
00081 class ITK_EXPORT ImageGaussianModelEstimator: 
00082     public ImageModelEstimatorBase<TInputImage, TMembershipFunction>
00083 {
00084 public:
00086   typedef ImageGaussianModelEstimator   Self;
00087   typedef ImageModelEstimatorBase<TInputImage,TMembershipFunction> Superclass;
00088 
00089   typedef SmartPointer<Self>  Pointer;
00090   typedef SmartPointer<const Self>  ConstPointer;
00091 
00093   itkNewMacro(Self);
00094 
00096   itkTypeMacro(ImageGaussianModelEstimator, ImageModelEstimatorBase);
00097 
00099   typedef typename TInputImage::Pointer   InputImagePointer;
00100  
00102   typedef typename TTrainingImage::Pointer TrainingImagePointer;
00103     
00106   typedef typename TInputImage::PixelType InputImagePixelType;        
00107 
00110   typedef typename TTrainingImage::PixelType TrainingImagePixelType;
00111 
00113   typedef
00114   ImageRegionIterator< TInputImage >  InputImageIterator;
00115   typedef
00116   ImageRegionIterator< TTrainingImage > TrainingImageIterator;
00117 
00119   typedef typename TMembershipFunction::Pointer MembershipFunctionPointer ;
00120 
00122   itkSetMacro(TrainingImage,TrainingImagePointer);
00123 
00125   itkGetMacro(TrainingImage,TrainingImagePointer);
00126 
00127 
00128 
00129 protected: 
00130   ImageGaussianModelEstimator();
00131   ~ImageGaussianModelEstimator();
00132   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00133 
00135   void GenerateData() ;
00136 
00137 private:
00138   ImageGaussianModelEstimator(const Self&); //purposely not implemented
00139   void operator=(const Self&); //purposely not implemented
00140 
00141   typedef vnl_matrix<double> MatrixType; 
00142   typedef vnl_vector<double> VectorType;
00143 
00144   typedef typename TInputImage::SizeType InputImageSizeType;
00145 
00147   itkStaticConstMacro(VectorDimension, unsigned int,
00148                       InputImagePixelType::Dimension);
00149   typedef vnl_matrix_fixed<double,1,itkGetStaticConstMacro(VectorDimension)> ColumnVectorType;
00150 
00151   MatrixType            m_NumberOfSamples;
00152   MatrixType            m_Means;
00153   MatrixType            *m_Covariance;  
00154 
00155   TrainingImagePointer  m_TrainingImage;
00156 
00160   virtual void EstimateModels();
00161 
00162   void EstimateGaussianModelParameters();
00163 
00164 }; // class ImageGaussianModelEstimator
00165 
00166 } // namespace itk
00167 
00168 #ifndef ITK_MANUAL_INSTANTIATION
00169 #include "itkImageGaussianModelEstimator.txx"
00170 #endif
00171 
00172 
00173 
00174 #endif

Generated at Wed May 24 23:19:22 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000