00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkShapeDetectionLevelSetFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/02/14 17:14:47 $ 00007 Version: $Revision: 1.3 $ 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 __itkShapeDetectionLevelSetFunction_h_ 00018 #define __itkShapeDetectionLevelSetFunction_h_ 00019 00020 #include "itkSegmentationLevelSetFunction.h" 00021 00022 namespace itk { 00023 00058 template <class TImageType, class TFeatureImageType = TImageType> 00059 class ITK_EXPORT ShapeDetectionLevelSetFunction 00060 : public SegmentationLevelSetFunction<TImageType, TFeatureImageType> 00061 { 00062 public: 00064 typedef ShapeDetectionLevelSetFunction Self; 00065 typedef SegmentationLevelSetFunction<TImageType> Superclass; 00066 typedef SmartPointer<Self> Pointer; 00067 typedef SmartPointer<const Self> ConstPointer; 00068 typedef TFeatureImageType FeatureImageType; 00069 00071 itkNewMacro(Self); 00072 00074 itkTypeMacro( ShapeDetectionLevelSetFunction, SegmentationLevelSetFunction ); 00075 00077 typedef typename Superclass::ImageType ImageType; 00078 typedef typename Superclass::NeighborhoodType NeighborhoodType; 00079 typedef typename Superclass::ScalarValueType ScalarValueType; 00080 typedef typename Superclass::FeatureScalarType FeatureScalarType; 00081 typedef typename Superclass::RadiusType RadiusType; 00082 typedef typename Superclass::FloatOffsetType FloatOffsetType; 00083 00085 itkStaticConstMacro(ImageDimension, unsigned int, 00086 Superclass::ImageDimension); 00087 00088 virtual void CalculateSpeedImage(); 00089 00091 virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood, 00092 const FloatOffsetType & offset ) const 00093 { return PropagationSpeed( neighborhood, offset ); } 00094 00095 virtual void Initialize(const RadiusType &r) 00096 { 00097 Superclass::Initialize(r); 00098 00099 this->SetAdvectionWeight( NumericTraits<ScalarValueType>::Zero ); 00100 this->SetPropagationWeight( NumericTraits<ScalarValueType>::One ); 00101 this->SetCurvatureWeight( NumericTraits<ScalarValueType>::One ); 00102 } 00103 00104 protected: 00105 ShapeDetectionLevelSetFunction() 00106 { 00107 this->SetAdvectionWeight( NumericTraits<ScalarValueType>::Zero ); 00108 this->SetPropagationWeight( NumericTraits<ScalarValueType>::One ); 00109 this->SetCurvatureWeight( NumericTraits<ScalarValueType>::One ); 00110 } 00111 virtual ~ShapeDetectionLevelSetFunction() {} 00112 00113 ShapeDetectionLevelSetFunction(const Self&); //purposely not implemented 00114 void operator=(const Self&); //purposely not implemented 00115 00116 void PrintSelf(std::ostream& os, Indent indent) const 00117 { 00118 Superclass::PrintSelf(os, indent ); 00119 } 00120 00121 }; 00122 00123 } // end namespace itk 00124 00125 #ifndef ITK_MANUAL_INSTANTIATION 00126 #include "itkShapeDetectionLevelSetFunction.txx" 00127 #endif 00128 00129 #endif