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

Review/Statistics/itkMixtureModelComponentBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMixtureModelComponentBase.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-02 05:43:58 $
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 #ifndef __itkMixtureModelComponentBase_h
00018 #define __itkMixtureModelComponentBase_h
00019 
00020 #include <vnl/vnl_vector.h>
00021 #include <vnl/vnl_matrix.h>
00022 
00023 #include "itkArray.h"
00024 #include "itkObject.h"
00025 #include "itkMembershipFunctionBase.h"
00026 
00027 namespace itk { 
00028 namespace Statistics {
00029   
00052 template< class TSample >
00053 class ITK_EXPORT MixtureModelComponentBase :
00054     public Object
00055 {
00056 public:
00058   typedef MixtureModelComponentBase   Self;
00059   typedef Object                      Superclass;
00060   typedef SmartPointer<Self>          Pointer;
00061   typedef SmartPointer<const Self>    ConstPointer;
00062 
00064   itkTypeMacro(MixtureModelComponentBase, Object);
00065 
00066   typedef typename TSample::MeasurementVectorType     MeasurementVectorType;
00067   typedef typename TSample::MeasurementVectorSizeType MeasurementVectorSizeType;
00068 
00070   typedef MembershipFunctionBase< MeasurementVectorType >
00071   MembershipFunctionType;
00072 
00074   typedef Array< double > WeightArrayType;
00075 
00076   typedef Array< double > ParametersType;
00077 
00079   virtual void SetSample(const TSample* sample);
00080 
00082   const TSample* GetSample() const;
00083 
00088   MembershipFunctionType* GetMembershipFunction();
00089 
00090   void SetMinimalParametersChange(double change)
00091     { 
00092     m_MinimalParametersChange = change;
00093     }
00094 
00095   double GetMinimalParametersChange()
00096     { 
00097     return m_MinimalParametersChange;
00098     }
00099 
00100   virtual void SetParameters(const ParametersType &parameters);
00101 
00102   virtual ParametersType GetFullParameters()
00103     {
00104     return m_Parameters;
00105     }
00106 
00109   void AreParametersModified(bool flag);
00110 
00112   bool AreParametersModified();
00113 
00115   void SetWeight(unsigned int index, double value);
00116 
00118   double GetWeight(unsigned int index) const;
00119 
00121   double Evaluate(MeasurementVectorType& measurements);
00122 
00124   itkGetConstReferenceMacro( Weights, WeightArrayType );
00125 
00126   virtual void Update();
00127   
00128 protected:
00129   MixtureModelComponentBase();
00130   virtual ~MixtureModelComponentBase();
00131   void PrintSelf(std::ostream& os, Indent indent) const;
00132 
00136   void SetMembershipFunction(MembershipFunctionType* function);
00137 
00138   virtual void GenerateData() = 0;
00139 
00140 private:
00142   const TSample* m_Sample;
00143 
00144   double m_MinimalParametersChange;
00145 
00146   ParametersType m_Parameters;
00147 
00149   MembershipFunctionType* m_MembershipFunction;
00150 
00152   WeightArrayType m_Weights;
00153 
00155   bool m_ParametersModified;
00156 
00157 }; // end of class
00158     
00159 } // end of namespace Statistics 
00160 } // end of namespace itk 
00161 
00162 #ifndef ITK_MANUAL_INSTANTIATION
00163 #include "itkMixtureModelComponentBase.txx"
00164 #endif
00165 
00166 #endif
00167 

Generated at Thu May 28 10:48:01 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000