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