00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkCannySegmentationLevelSetFunction_h_
00018 #define __itkCannySegmentationLevelSetFunction_h_
00019
00020 #include "itkSegmentationLevelSetFunction.h"
00021
00022 namespace itk {
00023
00029 template <class TImageType, class TFeatureImageType = TImageType>
00030 class ITK_EXPORT CannySegmentationLevelSetFunction
00031 : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
00032 {
00033 public:
00035 typedef CannySegmentationLevelSetFunction Self;
00036 typedef SegmentationLevelSetFunction<TImageType, TFeatureImageType> Superclass;
00037 typedef SmartPointer<Self> Pointer;
00038 typedef SmartPointer<const Self> ConstPointer;
00039 typedef TFeatureImageType FeatureImageType;
00040
00042 itkNewMacro(Self);
00043
00045 itkTypeMacro( CannySegmentationLevelSetFunction, SegmentationLevelSetFunction );
00046
00048 typedef typename Superclass::ImageType ImageType;
00049 typedef typename Superclass::ScalarValueType ScalarValueType;
00050 typedef typename Superclass::VectorImageType VectorImageType;
00051 typedef typename Superclass::FeatureScalarType FeatureScalarType;
00052 typedef typename Superclass::RadiusType RadiusType;
00053
00055 itkStaticConstMacro(ImageDimension, unsigned int,
00056 Superclass::ImageDimension);
00057
00059 void SetThreshold(ScalarValueType v)
00060 { m_Threshold = v; }
00061 ScalarValueType GetThreshold() const
00062 { return m_Threshold; }
00063
00065 void SetVariance(double v)
00066 { m_Variance = v; }
00067 double GetVariance() const
00068 { return m_Variance; }
00069
00072 virtual void CalculateAdvectionImage();
00073
00074 virtual void Initialize(const RadiusType &r)
00075 {
00076 Superclass::Initialize(r);
00077
00078 this->SetAdvectionWeight(-1.0 * NumericTraits<ScalarValueType>::One);
00079 this->SetPropagationWeight(-1.0 * NumericTraits<ScalarValueType>::One);
00080 this->SetCurvatureWeight(NumericTraits<ScalarValueType>::One);
00081 }
00082
00083 protected:
00084 CannySegmentationLevelSetFunction()
00085 {
00086 m_Variance = 0.0;
00087 m_Threshold = NumericTraits<ScalarValueType>::Zero;
00088 }
00089 virtual ~CannySegmentationLevelSetFunction() {}
00090
00091 CannySegmentationLevelSetFunction(const Self&);
00092 void operator=(const Self&);
00093
00094 private:
00095 ScalarValueType m_Variance;
00096 double m_Threshold;
00097 };
00098
00099 }
00100
00101 #ifndef ITK_MANUAL_INSTANTIATION
00102 #include "itkCannySegmentationLevelSetFunction.txx"
00103 #endif
00104
00105 #endif