00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkCannySegmentationLevelSetFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/11/24 13:43:24 $ 00007 Version: $Revision: 1.2 $ 00008 00009 Copyright (c) 2002 Insight 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 __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> 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&); //purposely not implemented 00092 void operator=(const Self&); //purposely not implemented 00093 00094 void PrintSelf(std::ostream& os, Indent indent) const 00095 { 00096 Superclass::PrintSelf(os, indent ); 00097 } 00098 00099 private: 00100 ScalarValueType m_Variance; 00101 double m_Threshold; 00102 }; 00103 00104 } // end namespace itk 00105 00106 #ifndef ITK_MANUAL_INSTANTIATION 00107 #include "itkCannySegmentationLevelSetFunction.txx" 00108 #endif 00109 00110 #endif