]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Functors/ImageFunction.h
a1cc9ecd955943c7a8e69abcfb441da43956ce62
[FrontAlgorithms.git] / lib / fpa / Image / Functors / ImageFunction.h
1 #ifndef __FPA__IMAGE__FUNCTORS__IMAGEFUNCTION__H__
2 #define __FPA__IMAGE__FUNCTORS__IMAGEFUNCTION__H__
3
4 #include <itkFunctionBase.h>
5
6 namespace fpa
7 {
8   namespace Image
9   {
10     namespace Functors
11     {
12       /**
13        */
14       template< class I, class O >
15       class ImageFunction
16         : public itk::FunctionBase< typename I::IndexType, O >
17       {
18       public:
19         /// Type-related and pointers
20         typedef ImageFunction                                 Self;
21         typedef itk::FunctionBase< typename I::IndexType, O > Superclass;
22         typedef itk::SmartPointer< Self >                     Pointer;
23         typedef itk::SmartPointer< const Self >               ConstPointer;
24
25         typedef I TInputImage;
26         typedef O TOutputValue;
27         typedef typename I::IndexType TIndex;
28
29       public:
30         itkTypeMacro( ImageFunction, itkFunctionBase );
31
32         itkGetConstObjectMacro( InputImage, I );
33         itkSetConstObjectMacro( InputImage, I );
34
35       public:
36         virtual O Evaluate( const TIndex& idx ) const = 0;
37
38       protected:
39         ImageFunction( )
40           : Superclass( )
41           { }
42         virtual ~ImageFunction( )
43           { }
44
45       private:
46         // Purposely not implemented
47         ImageFunction( const Self& );
48         void operator=( const Self& );
49
50       protected:
51         typename I::ConstPointer m_InputImage;
52       };
53
54     } // ecapseman
55
56   } // ecapseman
57
58 } // ecapseman
59
60 #endif // __FPA__IMAGE__FUNCTORS__IMAGEFUNCTION__H__
61
62 // eof - $RCSfile$