]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrow.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Base__RegionGrow__h__
7 #define __fpa__Base__RegionGrow__h__
8
9 #include <itkFunctionBase.h>
10
11 namespace fpa
12 {
13   namespace Base
14   {
15     /**
16      */
17     template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
18     class RegionGrow
19       : public _TFilter,
20         public _TMarksInterface,
21         public _TSeedsInterface
22     {
23     public:
24       typedef RegionGrow                      Self;
25       typedef _TFilter                        Superclass;
26       typedef _TMarksInterface                TMarksInterface;
27       typedef _TSeedsInterface                TSeedsInterface;
28       typedef itk::SmartPointer< Self >       Pointer;
29       typedef itk::SmartPointer< const Self > ConstPointer;
30
31       typedef typename Superclass::TInputValue  TInputValue;
32       typedef typename Superclass::TOutputValue TOutputValue;
33       typedef typename Superclass::TVertex      TVertex;
34       typedef typename Superclass::TVertices    TVertices;
35
36       typedef itk::FunctionBase< TInputValue, bool > TIntensityFunctor;
37       typedef itk::FunctionBase< TVertex, bool >     TVertexFunctor;
38
39     public:
40       itkTypeMacro( RegionGrow, TFilter );
41
42       itkGetConstMacro( InsideValue, TOutputValue );
43       itkGetConstMacro( OutsideValue, TOutputValue );
44
45       itkSetMacro( InsideValue, TOutputValue );
46       itkSetMacro( OutsideValue, TOutputValue );
47
48     public:
49       const TIntensityFunctor* GetIntensityPredicate( ) const;
50       const TVertexFunctor* GetVertexPredicate( ) const;
51
52       void SetPredicate( TIntensityFunctor* functor );
53       void SetPredicate( TVertexFunctor* functor );
54
55     protected:
56       RegionGrow( );
57       virtual ~RegionGrow( );
58
59       virtual void GenerateData( ) override;
60
61     private:
62       RegionGrow( const Self& other );
63       Self& operator=( const Self& other );
64
65     protected:
66       typename TIntensityFunctor::Pointer m_IntensityFunctor;
67       typename TVertexFunctor::Pointer m_VertexFunctor;
68       TOutputValue m_InsideValue;
69       TOutputValue m_OutsideValue;
70     };
71
72   } // ecapseman
73
74 } // ecapseman
75
76 #ifndef ITK_MANUAL_INSTANTIATION
77 #  include <fpa/Base/RegionGrow.hxx>
78 #endif // ITK_MANUAL_INSTANTIATION
79
80 #endif // __fpa__Base__RegionGrow__h__
81
82 // eof - $RCSfile$