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

itkExpectationMaximizationMixtureModelEstimator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkExpectationMaximizationMixtureModelEstimator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/07/26 15:54:55 $
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 __itkExpectationMaximizationMixtureModelEstimator_h
00018 #define __itkExpectationMaximizationMixtureModelEstimator_h
00019 
00020 #include "itkMembershipFunctionBase.h"
00021 #include "itkMixtureModelComponentBase.h"
00022 
00023 namespace itk{ 
00024 namespace Statistics{
00025 
00052 template< class TSample >
00053 class ITK_EXPORT ExpectationMaximizationMixtureModelEstimator : public Object
00054 {
00055 public:
00057   typedef ExpectationMaximizationMixtureModelEstimator Self;
00058   typedef Object Superclass;
00059   typedef SmartPointer< Self > Pointer;
00060   typedef SmartPointer<const Self> ConstPointer;
00061 
00063   itkTypeMacro(ExpectationMaximizationMixtureModelEstimator,
00064                Object);
00065   itkNewMacro(Self) ;
00066 
00068   typedef typename TSample::MeasurementType MeasurementType ;
00069   typedef typename TSample::MeasurementVectorType MeasurementVectorType ;
00070 
00072   typedef MixtureModelComponentBase< TSample > ComponentType ;
00073 
00075   typedef std::vector< ComponentType* > ComponentVectorType ;
00076 
00078   typedef MembershipFunctionBase< MeasurementVectorType > 
00079   ComponentMembershipFunctionType ;
00080 
00082   typedef Array< double > ProportionVectorType ;
00083 
00085   void SetSample(const TSample* sample) ;
00086 
00088   const TSample* GetSample() const;
00089 
00092   void SetInitialProportions(ProportionVectorType &propotion) ;
00093   ProportionVectorType* GetInitialProportions() ;
00094 
00096   ProportionVectorType* GetProportions() ;
00097 
00102   void SetMaximumIteration(int numberOfIterations) ;
00103   int GetMaximumIteration() ;
00104 
00106   int GetCurrentIteration() 
00107   { return m_CurrentIteration ; }
00108 
00110   int AddComponent(ComponentType* component) ;
00111 
00113   unsigned int GetNumberOfComponents() ;
00114 
00116   void Update() ;
00117 
00119   enum TERMINATION_CODE { CONVERGED = 0, NOT_CONVERGED = 1 } ;
00120 
00122   TERMINATION_CODE GetTerminationCode() ;
00123 
00126   ComponentMembershipFunctionType* GetComponentMembershipFunction(int componentIndex) ;
00127 
00128 protected:
00129   ExpectationMaximizationMixtureModelEstimator() ;
00130   virtual ~ExpectationMaximizationMixtureModelEstimator() {}
00131   void PrintSelf(std::ostream& os, Indent indent) const ;
00132 
00133   bool CalculateDensities() ;
00134   double CalculateExpectation() ;
00135   bool UpdateComponentParameters() ;
00136   bool UpdateProportions() ;
00137 
00139   void GenerateData() ;
00140 
00141 private:
00143   const TSample* m_Sample ;
00144 
00145   int m_MaxIteration ;
00146   int m_CurrentIteration ;
00147   TERMINATION_CODE m_TerminationCode ;
00148   ComponentVectorType m_ComponentVector ;
00149   ProportionVectorType m_InitialProportions ;
00150   ProportionVectorType m_Proportions ;
00151 } ; // end of class
00152 
00153 
00154 } // end of namespace Statistics 
00155 } // end of namespace itk
00156 
00157 
00158 #ifndef ITK_MANUAL_INSTANTIATION
00159 #include "itkExpectationMaximizationMixtureModelEstimator.txx"
00160 #endif
00161 
00162 #endif
00163 
00164 
00165 
00166 
00167 
00168 
00169 

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