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 <cpExtensions/Config.h>
9 #include <itkImageToImageFilter.h>
11 namespace cpExtensions
17 template< class _TInput, class _TOutput, class _TFunction >
18 class ImageFunctionFilter
19 : public itk::ImageToImageFilter< _TInput, _TOutput >
22 typedef ImageFunctionFilter Self;
23 typedef itk::ImageToImageFilter< _TInput, _TOutput > Superclass;
24 typedef itk::SmartPointer< Self > Pointer;
25 typedef itk::SmartPointer< const Self > ConstPointer;
27 typedef _TInput TInput;
28 typedef _TOutput TOutput;
29 typedef _TFunction TFunction;
31 typedef typename TOutput::RegionType TRegion;
35 itkTypeMacro( ImageFunctionFilter, itkImageToImageFilter );
37 itkGetObjectMacro( Function, TFunction );
38 itkSetObjectMacro( Function, TFunction );
41 ImageFunctionFilter( );
42 virtual ~ImageFunctionFilter( );
44 virtual void BeforeThreadedGenerateData( ) cpExtensions_OVERRIDE;
45 virtual void ThreadedGenerateData(
46 const TRegion& region,
47 itk::ThreadIdType threadId
48 ) cpExtensions_OVERRIDE;
51 // Purposely not implemented.
52 ImageFunctionFilter( const Self& );
53 void operator=( const Self& );
56 typename TFunction::Pointer m_Function;
63 #ifndef ITK_MANUAL_INSTANTIATION
64 # include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
65 #endif // ITK_MANUAL_INSTANTIATION
67 #endif // __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__H__