00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkDistanceToCentroidMembershipFunction_h
00018 #define __itkDistanceToCentroidMembershipFunction_h
00019
00020 #include <vnl/vnl_vector.h>
00021 #include <vnl/vnl_transpose.h>
00022 #include <vnl/vnl_matrix.h>
00023 #include <vnl/algo/vnl_matrix_inverse.h>
00024 #include <vnl/algo/vnl_determinant.h>
00025
00026
00027 #include "itkMembershipFunctionBase.h"
00028
00029
00030 namespace itk{
00031 namespace Statistics{
00032
00041 template< class TVector >
00042 class ITK_EXPORT DistanceToCentroidMembershipFunction :
00043 public MembershipFunctionBase< TVector >
00044 {
00045 public:
00047 typedef DistanceToCentroidMembershipFunction Self;
00048 typedef MembershipFunctionBase< TVector > Superclass ;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 itkTypeMacro(DistanceToCentroidMembershipFunction, MembershipFunctionBase);
00054 itkNewMacro(Self);
00056
00058 typedef TVector MeasurementVectorType ;
00059
00061 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
00062
00064 virtual void SetMeasurementVectorSize( const MeasurementVectorSizeType );
00065
00067 void SetCentroid(const vnl_vector<double> ¢roid) ;
00068
00070 const vnl_vector<double> & GetCentroid() const;
00071
00073 itkSetMacro( NumberOfSamples, int );
00074
00076 itkGetMacro( NumberOfSamples, int );
00077
00081 double Evaluate(const MeasurementVectorType &measurement) const;
00082
00083 protected:
00084 DistanceToCentroidMembershipFunction(void) ;
00085 virtual ~DistanceToCentroidMembershipFunction(void) {}
00086 void PrintSelf(std::ostream& os, Indent indent) const;
00087
00088 private:
00089 vnl_vector< double > m_Centroid;
00090
00091
00092 int m_NumberOfSamples;
00093 };
00094
00095 }
00096 }
00097
00098 #ifndef ITK_MANUAL_INSTANTIATION
00099 #include "itkDistanceToCentroidMembershipFunction.txx"
00100 #endif
00101
00102 #endif
00103