]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Functors/RegionGrowAllBelongsFunction.h
First commit
[FrontAlgorithms.git] / lib / fpa / Image / Functors / RegionGrowAllBelongsFunction.h
1 #ifndef __FPA__IMAGE__FUNCTORS__REGIONGROWALLBELONGSFUNCTION__H__
2 #define __FPA__IMAGE__FUNCTORS__REGIONGROWALLBELONGSFUNCTION__H__
3
4 #include <itkImageFunction.h>
5
6 namespace fpa
7 {
8   namespace Image
9   {
10     namespace Functors
11     {
12       /**
13        */
14       template< class I >
15       class RegionGrowAllBelongsFunction
16         : public itk::ImageFunction< I, bool >
17       {
18       public:
19         /// Type-related and pointers
20         typedef RegionGrowAllBelongsFunction    Self;
21         typedef itk::ImageFunction< I, bool >   Superclass;
22         typedef itk::SmartPointer< Self >       Pointer;
23         typedef itk::SmartPointer< const Self > ConstPointer;
24
25         // Superclass' types
26         typedef typename Superclass::InputImageType      InputImageType;
27         typedef typename Superclass::InputPixelType      InputPixelType;
28         typedef typename Superclass::OutputType          OutputType;
29         typedef typename Superclass::CoordRepType        CoordRepType;
30         typedef typename Superclass::IndexType           IndexType;
31         typedef typename Superclass::IndexValueType      IndexValueType;
32         typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
33         typedef typename Superclass::PointType           PointType;
34
35       public:
36         itkNewMacro( Self );
37         itkTypeMacro( RegionGrowAllBelongsFunction, itkImageFunction );
38
39       public:
40         virtual OutputType Evaluate( const PointType& point ) const
41           {
42             IndexType index;
43             this->ConvertPointToNearestIndex( point, index );
44             return( this->EvaluateAtIndex( index ) );
45           }
46         virtual OutputType EvaluateAtContinuousIndex(
47           const ContinuousIndexType& cindex
48           ) const
49           {
50             IndexType index;
51             this->ConvertContinuousIndexToNearestIndex( cindex, index );
52             return( this->EvaluateAtIndex( index ) );
53           }
54         virtual OutputType EvaluateAtIndex( const IndexType& index ) const
55           { return( true ); }
56
57       protected:
58         RegionGrowAllBelongsFunction( )
59           : Superclass( )
60           { }
61         virtual ~RegionGrowAllBelongsFunction( )
62           { }
63
64       private:
65         // Purposely not implemented
66         RegionGrowAllBelongsFunction( const Self& );
67         void operator=( const Self& );
68       };
69
70     } // ecapseman
71
72   } // ecapseman
73
74 } // ecapseman
75
76 #endif // __FPA__IMAGE__FUNCTORS__REGIONGROWALLBELONGSFUNCTION__H__
77
78 // eof - $RCSfile$