]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Functors/SimpleNeighborhood.h
...
[FrontAlgorithms.git] / lib / fpa / Image / Functors / SimpleNeighborhood.h
1 #ifndef __fpa__Image__Functors__SimpleNeighborhood__h__
2 #define __fpa__Image__Functors__SimpleNeighborhood__h__
3
4 #include <vector>
5 #include <fpa/Image/Functors/Base.h>
6 #include <itkFunctionBase.h>
7
8 namespace fpa
9 {
10   namespace Image
11   {
12     namespace Functors
13     {
14       /**
15        */
16       template< class _TImage >
17       class SimpleNeighborhood
18         : public fpa::Image::Functors::Base< _TImage, itk::FunctionBase< typename _TImage::IndexType, std::vector< typename _TImage::IndexType > > >
19       {
20       public:
21         typedef _TImage                         TImage;
22         typedef typename TImage::IndexType      TIndex;
23         typedef typename TIndex::OffsetType     TOffset;
24         typedef std::vector< TIndex >           TOutput;
25         typedef itk::FunctionBase< TIndex, TOutput > TBaseFunctor;
26         typedef fpa::Image::Functors::Base< TImage, TBaseFunctor > Superclass;
27         typedef SimpleNeighborhood              Self;
28         typedef itk::SmartPointer< Self >       Pointer;
29         typedef itk::SmartPointer< const Self > ConstPointer;
30
31       public:
32         itkNewMacro( Self );
33         itkTypeMacro( SimpleNeighborhood, Base );
34
35         itkGetConstMacro( Order, unsigned int );
36         itkSetMacro( Order, unsigned int );
37
38       public:
39         virtual TOutput Evaluate( const TIndex& center ) const override;
40
41       protected:
42         SimpleNeighborhood( );
43         virtual ~SimpleNeighborhood( );
44
45         void _1stCombination( ) const;
46         void _2ndCombination( ) const;
47
48       private:
49         // Purposely not implemented
50         SimpleNeighborhood( const Self& other );
51         Self& operator=( const Self& other );
52
53       protected:
54         unsigned int m_Order;
55         mutable std::vector< TOffset > m_Offsets;
56       };
57
58     } // ecapseman
59
60   } // ecapseman
61
62 } // ecapseman
63
64 #ifndef ITK_MANUAL_INSTANTIATION
65 #  include <fpa/Image/Functors/SimpleNeighborhood.hxx>
66 #endif // ITK_MANUAL_INSTANTIATION
67
68 #endif // __fpa__Image__Functors__SimpleNeighborhood__h__
69
70 // eof - $RCSfile$