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