00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkMahalanobisDistanceThresholdImageFunction_h
00018 #define _itkMahalanobisDistanceThresholdImageFunction_h
00019
00020 #include "itkImageFunction.h"
00021 #include "itkMahalanobisDistanceMembershipFunction.h"
00022
00023 namespace itk
00024 {
00025
00046 template <class TInputImage, class TCoordRep = float>
00047 class ITK_EXPORT MahalanobisDistanceThresholdImageFunction :
00048 public ImageFunction<TInputImage,bool,TCoordRep>
00049 {
00050 public:
00052 typedef MahalanobisDistanceThresholdImageFunction Self;
00053 typedef ImageFunction<TInputImage,bool,TCoordRep> Superclass;
00054 typedef SmartPointer<Self> Pointer;
00055 typedef SmartPointer<const Self> ConstPointer;
00056
00058 itkTypeMacro(MahalanobisDistanceThresholdImageFunction, ImageFunction);
00059
00061 itkNewMacro(Self);
00062
00064 typedef typename Superclass::InputImageType InputImageType;
00065
00067 typedef typename TInputImage::PixelType PixelType;
00068
00070 itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00071
00073 typedef typename Superclass::PointType PointType;
00074
00076 typedef typename Superclass::IndexType IndexType;
00077
00079 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00080
00082 typedef vnl_matrix<double> CovarianceMatrixType;
00083
00085 typedef vnl_vector<double> MeanVectorType;
00086
00095 virtual bool Evaluate( const PointType& point ) const;
00096
00105 virtual bool EvaluateAtContinuousIndex(
00106 const ContinuousIndexType & index ) const;
00107
00116 virtual bool EvaluateAtIndex( const IndexType & index ) const;
00117
00124 virtual double EvaluateDistance( const PointType& point ) const;
00125
00132 virtual double EvaluateDistanceAtIndex( const IndexType & index ) const;
00133
00135 itkGetConstReferenceMacro(Threshold,double);
00136 itkSetMacro(Threshold,double);
00137
00139 void SetMean(const MeanVectorType &mean);
00140 const MeanVectorType & GetMean() const;
00141
00146 void SetCovariance(const CovarianceMatrixType &cov);
00147 const CovarianceMatrixType & GetCovariance() const;
00148
00149
00150 protected:
00151 MahalanobisDistanceThresholdImageFunction();
00152 ~MahalanobisDistanceThresholdImageFunction(){};
00153 void PrintSelf(std::ostream& os, Indent indent) const;
00154
00155 private:
00156 MahalanobisDistanceThresholdImageFunction( const Self& );
00157 void operator=( const Self& );
00158
00159 double m_Threshold;
00160
00161
00162 typedef Statistics::MahalanobisDistanceMembershipFunction<
00163 PixelType
00164 > MahalanobisDistanceFunctionType;
00165
00166 typedef typename MahalanobisDistanceFunctionType::Pointer MahalanobisDistanceFunctionPointer;
00167 MahalanobisDistanceFunctionPointer m_MahalanobisDistanceMembershipFunction;
00168
00169 };
00170
00171 }
00172
00173 #ifndef ITK_MANUAL_INSTANTIATION
00174 #include "itkMahalanobisDistanceThresholdImageFunction.txx"
00175 #endif
00176
00177 #endif