]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/RegionGrow.h
Almost there...
[FrontAlgorithms.git] / lib / fpa / Image / RegionGrow.h
1 #ifndef __FPA__IMAGE__REGIONGROW__H__
2 #define __FPA__IMAGE__REGIONGROW__H__
3
4 #include <itkFunctionBase.h>
5 #include <itkImageToImageFilter.h>
6 #include <itkIndex.h>
7 #include <fpa/Base/RegionGrow.h>
8 #include <fpa/Image/Algorithm.h>
9
10 namespace fpa
11 {
12   namespace Image
13   {
14     /**
15      * @param I Input image type
16      * @param O Output image type
17      */
18     template< class I, class O >
19     class RegionGrow
20       : public Algorithm< I, O, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > >
21     {
22     public:
23       typedef fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
24
25       typedef RegionGrow                        Self;
26       typedef Algorithm< I, O, TBaseAlgorithm > Superclass;
27       typedef itk::SmartPointer< Self >         Pointer;
28       typedef itk::SmartPointer< const Self >   ConstPointer;
29
30       typedef typename Superclass::TInputImage  TInputImage;
31       typedef typename Superclass::TOutputImage TOutputImage;
32       typedef typename Superclass::TVertex      TVertex;
33       typedef typename Superclass::TValue       TValue;
34       typedef typename Superclass::TResult      TResult;
35
36       typedef itk::FunctionBase< TValue, bool > TMembershipFunction;
37
38     protected:
39       typedef typename Superclass::_TVertices      _TVertices;
40       typedef typename Superclass::_TCollision     _TCollision;
41       typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
42       typedef typename Superclass::_TCollisions    _TCollisions;
43       typedef typename Superclass::_TNode          _TNode;
44       typedef typename Superclass::_TNodes         _TNodes;
45
46     public:
47       itkNewMacro( Self );
48       itkTypeMacro( RegionGrow, Algorithm );
49
50       itkGetObjectMacro( MembershipFunction, TMembershipFunction );
51       itkGetConstObjectMacro( MembershipFunction, TMembershipFunction );
52       itkSetObjectMacro( MembershipFunction, TMembershipFunction );
53
54     protected:
55       RegionGrow( );
56       virtual ~RegionGrow( );
57
58       virtual bool _CheckMembership( const TVertex& v ) const;
59       virtual void _InitResults( );
60
61     private:
62       // Purposely not implemented
63       RegionGrow( const Self& other );
64       Self& operator=( const Self& other );
65
66     protected:
67       typename TMembershipFunction::Pointer m_MembershipFunction;
68     };
69
70   } // ecapseman
71
72 } // ecapseman
73
74 #include <fpa/Image/RegionGrow.hxx>
75
76 #endif // __FPA__IMAGE__REGIONGROW__H__
77
78 // eof - $RCSfile$