00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkCurvesLevelSetFunction_h_
00019 #define __itkCurvesLevelSetFunction_h_
00020
00021 #include "itkSegmentationLevelSetFunction.h"
00022
00023 namespace itk {
00024
00060 template <class TImageType, class TFeatureImageType = TImageType>
00061 class ITK_EXPORT CurvesLevelSetFunction
00062 : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
00063 {
00064 public:
00066 typedef CurvesLevelSetFunction Self;
00067 typedef SegmentationLevelSetFunction<TImageType> Superclass;
00068 typedef LevelSetFunction<TImageType> SuperSuperclass;
00069 typedef SmartPointer<Self> Pointer;
00070 typedef SmartPointer<const Self> ConstPointer;
00071 typedef TFeatureImageType FeatureImageType;
00072
00074 itkNewMacro(Self);
00075
00077 itkTypeMacro( CurvesLevelSetFunction, SegmentationLevelSetFunction );
00078
00080 typedef typename SuperSuperclass::PixelType PixelType;
00081 typedef typename Superclass::ImageType ImageType;
00082 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00083 typedef typename Superclass::ScalarValueType ScalarValueType;
00084 typedef typename Superclass::FeatureScalarType FeatureScalarType;
00085 typedef typename Superclass::RadiusType RadiusType;
00086 typedef typename SuperSuperclass::FloatOffsetType FloatOffsetType;
00087 typedef typename SuperSuperclass::GlobalDataStruct GlobalDataStruct;
00088 typedef typename Superclass::VectorImageType VectorImageType;
00089
00091 itkStaticConstMacro(ImageDimension, unsigned int,
00092 Superclass::ImageDimension);
00093
00095 virtual void CalculateSpeedImage();
00096
00098 virtual void CalculateAdvectionImage();
00099
00101 virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
00102 const FloatOffsetType & offset, GlobalDataStruct *gd ) const
00103 { return PropagationSpeed( neighborhood, offset, gd ); }
00104
00107 void SetDerivativeSigma( const double v )
00108 { m_DerivativeSigma = v; }
00109 double GetDerivativeSigma()
00110 { return m_DerivativeSigma; };
00112
00113 virtual void Initialize(const RadiusType &r);
00114
00115 protected:
00116 CurvesLevelSetFunction()
00117 {
00118
00119 this->UseMinimalCurvatureOn();
00120 this->SetAdvectionWeight( NumericTraits<ScalarValueType>::One );
00121 this->SetPropagationWeight( NumericTraits<ScalarValueType>::One );
00122 this->SetCurvatureWeight( NumericTraits<ScalarValueType>::One );
00123
00124
00125 m_DerivativeSigma = 1.0;
00126 }
00127 virtual ~CurvesLevelSetFunction() {}
00128
00129 CurvesLevelSetFunction(const Self&);
00130 void operator=(const Self&);
00131
00132 void PrintSelf(std::ostream& os, Indent indent) const
00133 {
00134 Superclass::PrintSelf(os, indent );
00135 os << indent << "DerivativeSigma: " << m_DerivativeSigma << std::endl;
00136 }
00137
00138 private:
00139
00141 std::slice x_slice[ImageDimension];
00142
00144 ::size_t m_Center;
00145
00147 ::size_t m_xStride[ImageDimension];
00148
00149
00150 double m_DerivativeSigma;
00151
00152 };
00153
00154 }
00155
00156 #ifndef ITK_MANUAL_INSTANTIATION
00157 #include "itkCurvesLevelSetFunction.txx"
00158 #endif
00159
00160 #endif
00161