00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkLaplacianSegmentationLevelSetFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-01-24 20:02:57 $ 00007 Version: $Revision: 1.9 $ 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 __itkLaplacianSegmentationLevelSetFunction_h 00018 #define __itkLaplacianSegmentationLevelSetFunction_h 00019 00020 #include "itkSegmentationLevelSetFunction.h" 00021 00022 namespace itk { 00023 00024 00032 template <class TImageType, class TFeatureImageType = TImageType> 00033 class ITK_EXPORT LaplacianSegmentationLevelSetFunction 00034 : public SegmentationLevelSetFunction<TImageType, TFeatureImageType> 00035 { 00036 public: 00038 typedef LaplacianSegmentationLevelSetFunction Self; 00039 typedef SegmentationLevelSetFunction<TImageType, TFeatureImageType> 00040 Superclass; 00041 typedef SmartPointer<Self> Pointer; 00042 typedef SmartPointer<const Self> ConstPointer; 00043 typedef TFeatureImageType FeatureImageType; 00044 00046 itkNewMacro(Self); 00047 00049 itkTypeMacro( LaplacianSegmentationLevelSetFunction, SegmentationLevelSetFunction ); 00050 00052 typedef typename Superclass::ImageType ImageType; 00053 typedef typename Superclass::ScalarValueType ScalarValueType; 00054 typedef typename Superclass::FeatureScalarType FeatureScalarType; 00055 typedef typename Superclass::RadiusType RadiusType; 00056 00058 itkStaticConstMacro(ImageDimension, unsigned int, 00059 Superclass::ImageDimension); 00060 00061 00062 virtual void CalculateSpeedImage(); 00063 00064 virtual void Initialize(const RadiusType &r) 00065 { 00066 Superclass::Initialize(r); 00067 00068 this->SetAdvectionWeight( NumericTraits<ScalarValueType>::Zero); 00069 this->SetPropagationWeight(-1.0 * NumericTraits<ScalarValueType>::One); 00070 this->SetCurvatureWeight(NumericTraits<ScalarValueType>::One); 00071 } 00072 00079 void SetAdvectionWeight(const ScalarValueType value) 00080 { 00081 if (value == NumericTraits<ScalarValueType>::Zero) 00082 { 00083 Superclass::SetAdvectionWeight(value); 00084 } 00085 } 00087 00088 protected: 00089 00090 LaplacianSegmentationLevelSetFunction() 00091 { 00092 this->SetAdvectionWeight(0.0); 00093 this->SetPropagationWeight(1.0); 00094 this->SetCurvatureWeight(1.0); 00095 } 00096 virtual ~LaplacianSegmentationLevelSetFunction() {} 00097 00098 LaplacianSegmentationLevelSetFunction(const Self&); //purposely not implemented 00099 void operator=(const Self&); //purposely not implemented 00100 }; 00101 00102 } // end namespace itk 00103 00104 #ifndef ITK_MANUAL_INSTANTIATION 00105 #include "itkLaplacianSegmentationLevelSetFunction.txx" 00106 #endif 00107 00108 #endif 00109