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: 2009-01-24 20:02:54 $
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 #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   typedef SmartPointer<Self>                                       Pointer;
00089   typedef SmartPointer<const Self>                                 ConstPointer;
00090 
00092   itkNewMacro(Self);
00093 
00095   itkTypeMacro(ImageGaussianModelEstimator, ImageModelEstimatorBase);
00096 
00098   typedef typename TInputImage::Pointer   InputImagePointer;
00099 
00101   typedef typename TTrainingImage::Pointer TrainingImagePointer;
00102 
00105   typedef typename TInputImage::PixelType InputImagePixelType;
00106 
00109   typedef typename TTrainingImage::PixelType TrainingImagePixelType;
00110 
00112   typedef ImageRegionIterator< TInputImage >    InputImageIterator;
00113   typedef ImageRegionIterator< TTrainingImage > TrainingImageIterator;
00114 
00116   typedef typename TMembershipFunction::Pointer MembershipFunctionPointer;
00117 
00119   itkSetMacro(TrainingImage,TrainingImagePointer);
00120 
00122   itkGetMacro(TrainingImage,TrainingImagePointer);
00123 
00124 protected: 
00125   ImageGaussianModelEstimator();
00126   ~ImageGaussianModelEstimator();
00127   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00128 
00130   void GenerateData();
00131 
00132 private:
00133   ImageGaussianModelEstimator(const Self&); //purposely not implemented
00134   void operator=(const Self&); //purposely not implemented
00135 
00136   typedef vnl_matrix<double> MatrixType; 
00137   typedef vnl_vector<double> VectorType;
00138 
00139   typedef typename TInputImage::SizeType InputImageSizeType;
00140 
00142   itkStaticConstMacro(VectorDimension, unsigned int,
00143                       InputImagePixelType::Dimension);
00144   typedef vnl_matrix_fixed<double,1,itkGetStaticConstMacro(VectorDimension)> ColumnVectorType;
00146 
00147   MatrixType            m_NumberOfSamples;
00148   MatrixType            m_Means;
00149   MatrixType           *m_Covariance;  
00150 
00151   TrainingImagePointer  m_TrainingImage;
00152 
00156   virtual void EstimateModels();
00157 
00158   void EstimateGaussianModelParameters();
00159 
00160 }; // class ImageGaussianModelEstimator
00161 
00162 } // namespace itk
00163 
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkImageGaussianModelEstimator.txx"
00166 #endif
00167 
00168 #endif
00169 

Generated at Sat Feb 28 12:39:09 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000