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