1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
5 #ifndef __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__H__
6 #define __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__H__
8 #include <itkImageToImageFilter.h>
10 namespace cpExtensions
16 template< class _TInput, class _TOutput, class _TFunction >
17 class ImageFunctionFilter
18 : public itk::ImageToImageFilter< _TInput, _TOutput >
21 typedef ImageFunctionFilter Self;
22 typedef itk::ImageToImageFilter< _TInput, _TOutput > Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
26 typedef _TInput TInput;
27 typedef _TOutput TOutput;
28 typedef _TFunction TFunction;
30 typedef typename TOutput::RegionType TRegion;
34 itkTypeMacro( ImageFunctionFilter, itkImageToImageFilter );
36 itkGetObjectMacro( Function, TFunction );
37 itkSetObjectMacro( Function, TFunction );
40 ImageFunctionFilter( );
41 virtual ~ImageFunctionFilter( );
43 virtual void BeforeThreadedGenerateData( ) ITK_OVERRIDE;
44 virtual void ThreadedGenerateData(
45 const TRegion& region,
46 itk::ThreadIdType threadId
50 // Purposely not implemented.
51 ImageFunctionFilter( const Self& );
52 void operator=( const Self& );
55 typename TFunction::Pointer m_Function;
62 #ifndef ITK_MANUAL_INSTANTIATION
63 #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
64 #endif // ITK_MANUAL_INSTANTIATION
66 #endif // __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__H__