]> Creatis software - cpPlugins.git/blob - lib/ivq/ITK/ImageROIFromFunction.h
6aef0f96edeca3c1747632aa61539200a683a00e
[cpPlugins.git] / lib / ivq / ITK / ImageROIFromFunction.h
1 /* =======================================================================
2  * @author: Leonardo Florez-Valencia
3  * @email: florez-l@javeriana.edu.co
4  * =======================================================================
5  */
6
7 #ifndef __ivq__ITK__ImageROIFromFunction__h__
8 #define __ivq__ITK__ImageROIFromFunction__h__
9
10 #include <itkFunctionBase.h>
11 #include <itkObject.h>
12
13 namespace ivq
14 {
15   namespace ITK
16   {
17     /**
18      */
19     template< class _TImage >
20     class ImageROIFromFunction
21       : public itk::Object
22     {
23     public:
24       typedef ImageROIFromFunction            Self;
25       typedef itk::Object                     Superclass;
26       typedef itk::SmartPointer< Self >       Pointer;
27       typedef itk::SmartPointer< const Self > ConstPointer;
28
29       typedef _TImage TImage;
30       typedef typename TImage::IndexType  TIndex;
31       typedef typename TImage::PixelType  TPixel;
32       typedef typename TImage::RegionType TRegion;
33
34       typedef itk::FunctionBase< TPixel, bool > TFunction;
35
36     public:
37       itkNewMacro( Self );
38       itkTypeMacro( ivq::ITK::ImageROIFromFunction, itk::Object );
39
40       itkGetConstObjectMacro( Image, TImage );
41       itkSetConstObjectMacro( Image, TImage );
42
43       itkGetObjectMacro( Function, TFunction );
44       itkGetConstObjectMacro( Function, TFunction );
45       itkSetObjectMacro( Function, TFunction );
46
47       itkGetConstMacro( Padding, unsigned int );
48       itkSetMacro( Padding, unsigned int );
49
50       itkGetConstReferenceMacro( ROI, TRegion );
51
52     public:
53       virtual void Modified( ) const override;
54       virtual void Compute( );
55
56     protected:
57       ImageROIFromFunction( );
58       virtual ~ImageROIFromFunction( );
59
60     private:
61       // Purposely not implemented
62       ImageROIFromFunction( Self& other );
63       Self& operator=( Self& other );
64
65     protected:
66       typename TImage::ConstPointer m_Image;
67       typename TFunction::Pointer   m_Function;
68       unsigned int m_Padding;
69       TRegion      m_ROI;
70       mutable bool m_ROIUpdated;
71     };
72
73   } // ecapseman
74
75 } // ecapseman
76
77 #ifndef ITK_MANUAL_INSTANTIATION
78 #  include <ivq/ITK/ImageROIFromFunction.hxx>
79 #endif // ITK_MANUAL_INSTANTIATION
80
81 #endif // __ivq__ITK__ImageROIFromFunction__h__
82
83 // eof - $RCSfile$