00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkGaussianMixtureModelComponent.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-05-02 05:43:55 $ 00007 Version: $Revision: 1.1 $ 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 00018 #ifndef __itkGaussianMixtureModelComponent_h 00019 #define __itkGaussianMixtureModelComponent_h 00020 00021 #include "itkMixtureModelComponentBase.h" 00022 #include "itkGaussianMembershipFunction.h" 00023 #include "itkWeightedMeanSampleFilter.h" 00024 #include "itkWeightedCovarianceSampleFilter.h" 00025 00026 namespace itk { 00027 namespace Statistics { 00028 00047 template< class TSample > 00048 class ITK_EXPORT GaussianMixtureModelComponent : 00049 public MixtureModelComponentBase< TSample > 00050 { 00051 public: 00053 typedef GaussianMixtureModelComponent Self; 00054 typedef MixtureModelComponentBase< TSample > Superclass; 00055 typedef SmartPointer<Self> Pointer; 00056 typedef SmartPointer<const Self> ConstPointer; 00057 00059 itkTypeMacro(GaussianMixtureModelComponent, MixtureModelComponentBase); 00060 itkNewMacro(Self); 00062 00063 00065 typedef typename Superclass::MeasurementVectorType MeasurementVectorType; 00066 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType; 00067 typedef typename Superclass::MembershipFunctionType MembershipFunctionType; 00068 typedef typename Superclass::WeightArrayType WeightArrayType; 00069 typedef typename Superclass::ParametersType ParametersType; 00070 00072 typedef GaussianMembershipFunction< MeasurementVectorType > 00073 NativeMembershipFunctionType; 00074 00077 typedef WeightedMeanSampleFilter< TSample > MeanEstimatorType; 00078 typedef WeightedCovarianceSampleFilter< TSample > CovarianceEstimatorType; 00079 00081 typedef typename MeanEstimatorType::OutputType MeanType; 00082 00084 typedef typename CovarianceEstimatorType::OutputType CovarianceType; 00085 00087 void SetSample(const TSample* sample); 00088 00090 void SetParameters(const ParametersType ¶meters); 00091 00092 protected: 00093 GaussianMixtureModelComponent(); 00094 virtual ~GaussianMixtureModelComponent() {} 00095 void PrintSelf(std::ostream& os, Indent indent) const; 00096 00099 double CalculateParametersChange(); 00100 00102 void GenerateData(); 00103 00104 private: 00105 typename NativeMembershipFunctionType::Pointer m_GaussianMembershipFunction; 00106 00107 typename MeanEstimatorType::MeasurementVectorType m_Mean; 00108 typename CovarianceEstimatorType::MatrixType m_Covariance; 00109 typename MeanEstimatorType::Pointer m_MeanEstimator; 00110 typename CovarianceEstimatorType::Pointer m_CovarianceEstimator; 00111 }; // end of class 00112 00113 } // end of namespace Statistics 00114 } // end of namespace itk 00115 00116 #ifndef ITK_MANUAL_INSTANTIATION 00117 #include "itkGaussianMixtureModelComponent.txx" 00118 #endif 00119 00120 #endif 00121