00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkGaussianMixtureModelComponent.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/09/22 17:35:49 $ 00007 Version: $Revision: 1.5 $ 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 00018 #ifndef __itkGaussianMixtureModelComponent_h 00019 #define __itkGaussianMixtureModelComponent_h 00020 00021 #include "itkMixtureModelComponentBase.h" 00022 #include "itkGaussianDensityFunction.h" 00023 #include "itkWeightedMeanCalculator.h" 00024 #include "itkWeightedCovarianceCalculator.h" 00025 00026 namespace itk{ 00027 namespace Statistics{ 00028 00041 template< class TSample > 00042 class GaussianMixtureModelComponent : 00043 public MixtureModelComponentBase< TSample > 00044 { 00045 public: 00047 typedef GaussianMixtureModelComponent Self; 00048 typedef MixtureModelComponentBase< TSample > Superclass ; 00049 typedef SmartPointer<Self> Pointer; 00050 00052 itkTypeMacro(GaussianMixtureModelComponent, MixtureModelComponentBase); 00053 itkNewMacro(Self) ; 00054 00056 itkStaticConstMacro(MeasurementVectorSize, unsigned int, 00057 TSample::MeasurementVectorSize); 00058 00059 typedef typename Superclass::MeasurementVectorType MeasurementVectorType ; 00060 typedef typename Superclass::MembershipFunctionType MembershipFunctionType ; 00061 typedef typename Superclass::WeightArrayType WeightArrayType ; 00062 typedef typename Superclass::ParametersType ParametersType ; 00063 00064 typedef GaussianDensityFunction< MeasurementVectorType > NativeMembershipFunctionType ; 00065 00066 typedef WeightedMeanCalculator< TSample > MeanEstimatorType ; 00067 typedef WeightedCovarianceCalculator< TSample > CovarianceEstimatorType ; 00068 00069 typedef typename MeanEstimatorType::OutputType MeanType ; 00070 typedef typename CovarianceEstimatorType::OutputType CovarianceType ; 00071 00072 void SetSample(TSample* sample) ; 00073 00074 void SetParameters(const ParametersType ¶meters) ; 00075 00076 protected: 00077 GaussianMixtureModelComponent() ; 00078 virtual ~GaussianMixtureModelComponent() {} 00079 void PrintSelf(std::ostream& os, Indent indent) const; 00080 00081 double CalculateParametersChange() ; 00082 00083 void GenerateData() ; 00084 00085 private: 00086 typename NativeMembershipFunctionType::Pointer m_GaussianDensityFunction ; 00087 MeanType m_Mean ; 00088 CovarianceType m_Covariance ; 00089 typename MeanEstimatorType::Pointer m_MeanEstimator ; 00090 typename CovarianceEstimatorType::Pointer m_CovarianceEstimator ; 00091 } ; // end of class 00092 00093 } // end of namespace Statistics 00094 } // end of namespace itk 00095 00096 #ifndef ITK_MANUAL_INSTANTIATION 00097 #include "itkGaussianMixtureModelComponent.txx" 00098 #endif 00099 00100 #endif 00101