1 /* =======================================================================
2 * @author: Leonardo Florez-Valencia
3 * @email: florez-l@javeriana.edu.co
4 * =======================================================================
7 #ifndef __ivq__ITK__ImageROIFromFunction__h__
8 #define __ivq__ITK__ImageROIFromFunction__h__
10 #include <itkFunctionBase.h>
11 #include <itkObject.h>
19 template< class _TImage >
20 class ImageROIFromFunction
24 typedef ImageROIFromFunction Self;
25 typedef itk::Object Superclass;
26 typedef itk::SmartPointer< Self > Pointer;
27 typedef itk::SmartPointer< const Self > ConstPointer;
29 typedef _TImage TImage;
30 typedef typename TImage::IndexType TIndex;
31 typedef typename TImage::PixelType TPixel;
32 typedef typename TImage::RegionType TRegion;
34 typedef itk::FunctionBase< TPixel, bool > TFunction;
38 itkTypeMacro( ivq::ITK::ImageROIFromFunction, itk::Object );
40 itkGetConstObjectMacro( Image, TImage );
41 itkSetConstObjectMacro( Image, TImage );
43 itkGetObjectMacro( Function, TFunction );
44 itkGetConstObjectMacro( Function, TFunction );
45 itkSetObjectMacro( Function, TFunction );
47 itkGetConstMacro( Padding, unsigned int );
48 itkSetMacro( Padding, unsigned int );
50 itkGetConstReferenceMacro( ROI, TRegion );
53 virtual void Modified( ) const override;
54 virtual void Compute( );
57 ImageROIFromFunction( );
58 virtual ~ImageROIFromFunction( );
61 // Purposely not implemented
62 ImageROIFromFunction( Self& other );
63 Self& operator=( Self& other );
66 typename TImage::ConstPointer m_Image;
67 typename TFunction::Pointer m_Function;
68 unsigned int m_Padding;
70 mutable bool m_ROIUpdated;
77 #ifndef ITK_MANUAL_INSTANTIATION
78 # include <ivq/ITK/ImageROIFromFunction.hxx>
79 #endif // ITK_MANUAL_INSTANTIATION
81 #endif // __ivq__ITK__ImageROIFromFunction__h__