1 #ifndef __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__
2 #define __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__
4 #include <itkImageFunction.h>
11 * Base class to compute values based on image gradients (vector).
13 template< class _TGradient >
14 class GradientImageFunctionBase
15 : public itk::ImageFunction< _TGradient, typename _TGradient::PixelType::ValueType, typename _TGradient::PixelType::ValueType >
18 // Types from input arguments
19 typedef _TGradient TGradient;
20 typedef typename _TGradient::PixelType TVector;
21 typedef typename TVector::ValueType TScalar;
22 itkStaticConstMacro( Dimension, unsigned int, _TGradient::ImageDimension );
25 typedef GradientImageFunctionBase Self;
26 typedef itk::ImageFunction< _TGradient, TScalar, TScalar > Superclass;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 // Types from base itk::ImageFunction
31 typedef typename Superclass::InputType TInput;
32 typedef typename Superclass::OutputType TOutput;
33 typedef typename Superclass::PointType TPoint;
34 typedef typename Superclass::ContinuousIndexType TContIndex;
35 typedef typename Superclass::IndexType TIndex;
38 itkTypeMacro( GradientImageFunctionBase, itkImageFunction );
41 virtual void Prepare( ) const;
42 virtual TOutput Evaluate( const TPoint& p ) const ITK_OVERRIDE;
43 virtual TOutput EvaluateAtIndex( const TIndex& i ) const ITK_OVERRIDE;
44 virtual TOutput EvaluateAtContinuousIndex( const TContIndex& i ) const ITK_OVERRIDE;
47 GradientImageFunctionBase( );
48 virtual ~GradientImageFunctionBase( );
50 virtual TOutput _Evaluate( const TIndex& i ) const = 0;
53 // Purposely not implemented.
54 GradientImageFunctionBase( const Self& );
55 void operator=( const Self& );
62 #ifndef ITK_MANUAL_INSTANTIATION
63 # include <cpExtensions/Algorithms/GradientImageFunctionBase.hxx>
64 #endif // ITK_MANUAL_INSTANTIATION
66 #endif // __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__