1 #ifndef __FPA__IMAGE__FUNCTORS__GRADIENTIMAGEFUNCTIONBASE__H__
2 #define __FPA__IMAGE__FUNCTORS__GRADIENTIMAGEFUNCTIONBASE__H__
4 #include <itkImageFunction.h>
13 * Base class to compute values based on image gradients (vector).
14 * It allows incremental computation of the gradient.
16 template< class _TGradient >
17 class GradientImageFunctionBase
18 : public itk::ImageFunction< _TGradient, typename _TGradient::PixelType::ValueType, typename _TGradient::PixelType::ValueType >
21 // Types from input arguments
22 typedef _TGradient TGradient;
23 typedef typename _TGradient::PixelType TVector;
24 typedef typename TVector::ValueType TScalar;
25 itkStaticConstMacro( Dimension, unsigned int, _TGradient::ImageDimension );
28 typedef GradientImageFunctionBase Self;
29 typedef itk::ImageFunction< _TGradient, TScalar, TScalar > Superclass;
30 typedef itk::SmartPointer< Self > Pointer;
31 typedef itk::SmartPointer< const Self > ConstPointer;
33 // Types from base itk::ImageFunction
34 typedef typename Superclass::InputType TInput;
35 typedef typename Superclass::OutputType TOutput;
36 typedef typename Superclass::PointType TPoint;
37 typedef typename Superclass::ContinuousIndexType TContIndex;
38 typedef typename Superclass::IndexType TIndex;
41 itkTypeMacro( GradientImageFunctionBase, itkImageFunction );
44 virtual void Prepare( ) const;
45 virtual TOutput Evaluate( const TPoint& p ) const ITK_OVERRIDE;
46 virtual TOutput EvaluateAtIndex( const TIndex& i ) const ITK_OVERRIDE;
47 virtual TOutput EvaluateAtContinuousIndex( const TContIndex& i ) const ITK_OVERRIDE;
50 GradientImageFunctionBase( );
51 virtual ~GradientImageFunctionBase( );
53 virtual TOutput _Evaluate( const TIndex& i ) const = 0;
56 // Purposely not implemented.
57 GradientImageFunctionBase( const Self& );
58 void operator=( const Self& );
67 #ifndef ITK_MANUAL_INSTANTIATION
68 #include <fpa/Image/Functors/GradientImageFunctionBase.hxx>
69 #endif // ITK_MANUAL_INSTANTIATION
71 #endif // __FPA__IMAGE__FUNCTORS__GRADIENTIMAGEFUNCTIONBASE__H__