00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMinMaxCurvatureFlowFunction_h_
00018 #define __itkMinMaxCurvatureFlowFunction_h_
00019
00020 #include "itkCurvatureFlowFunction.h"
00021 #include "itkMacro.h"
00022 #include "itkNeighborhoodOperator.h"
00023
00024 namespace itk {
00025
00040 template <class TImage>
00041 class MinMaxCurvatureFlowFunction :
00042 public CurvatureFlowFunction<TImage>
00043 {
00044 public:
00046 typedef MinMaxCurvatureFlowFunction Self;
00047 typedef CurvatureFlowFunction<TImage> Superclass;
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00052 itkNewMacro(Self);
00053
00055 itkTypeMacro( MinMaxCurvatureFlowFunction,
00056 CurvatureFlowFunction );
00057
00059 typedef typename Superclass::ImageType ImageType;
00060 typedef typename Superclass::PixelType PixelType;
00061 typedef typename Superclass::RadiusType RadiusType;
00062 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00063 typedef typename Superclass::BoundaryNeighborhoodType BoundaryNeighborhoodType;
00064 typedef typename Superclass::FloatOffsetType FloatOffsetType;
00065
00067 itkStaticConstMacro(ImageDimension, unsigned int,
00068 Superclass::ImageDimension);
00069
00071 typedef typename RadiusType::SizeValueType RadiusValueType;
00072
00074 void SetStencilRadius( const RadiusValueType radius );
00075 const RadiusValueType &GetRadiusValueType() const
00076 { return m_StencilRadius; }
00077
00080 virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00081 void * globalData,
00082 const FloatOffsetType& offset = m_ZeroOffset
00083 ) const;
00084
00087 virtual PixelType ComputeUpdate(const BoundaryNeighborhoodType
00088 &neighborhood, void * globalData,
00089 const FloatOffsetType& offset = m_ZeroOffset
00090 ) const;
00091
00092 protected:
00093 MinMaxCurvatureFlowFunction();
00094 ~MinMaxCurvatureFlowFunction() {}
00095
00096 typedef Neighborhood<PixelType,itkGetStaticConstMacro(ImageDimension)> StencilOperatorType;
00097 StencilOperatorType m_StencilOperator;
00098
00101 void InitializeStencilOperator();
00102
00103
00104 private:
00105 MinMaxCurvatureFlowFunction(const Self&);
00106 void operator=(const Self&);
00107
00108 RadiusValueType m_StencilRadius;
00109
00110
00111 struct DispatchBase {};
00112 template<signed int VDimension>
00113 struct Dispatch : DispatchBase {};
00114
00117 virtual PixelType ComputeThreshold( const Dispatch<2> &,
00118 const NeighborhoodType & neighborhood ) const;
00119 virtual PixelType ComputeThreshold( const Dispatch<2> &,
00120 const BoundaryNeighborhoodType & neighborhood ) const;
00121 virtual PixelType ComputeThreshold( const Dispatch<3> &,
00122 const NeighborhoodType & neighborhood ) const;
00123 virtual PixelType ComputeThreshold( const Dispatch<3> &,
00124 const BoundaryNeighborhoodType & neighborhood ) const;
00125 virtual PixelType ComputeThreshold( const DispatchBase &,
00126 const NeighborhoodType & neighborhood ) const;
00127 virtual PixelType ComputeThreshold( const DispatchBase &,
00128 const BoundaryNeighborhoodType & neighborhood ) const;
00129
00130
00131 };
00132
00133 }
00134
00135 #ifndef ITK_MANUAL_INSTANTIATION
00136 #include "itkMinMaxCurvatureFlowFunction.txx"
00137 #endif
00138
00139 #endif