]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Filters/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Filters / RegionGrow.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__RegionGrow__h__
6 #define __fpa__Filters__RegionGrow__h__
7
8 #include <itkFunctionBase.h>
9 #include <fpa/Config.h>
10 #include <fpa/Filters/QueueAlgorithm.h>
11 #include <fpa/Functors/VertexFunction.h>
12
13 namespace fpa
14 {
15   namespace Filters
16   {
17     /**
18      */
19     template< class _TDataInterface >
20     class RegionGrow
21       : public fpa::Filters::QueueAlgorithm< _TDataInterface >
22     {
23     public:
24       typedef _TDataInterface TDataInterface;
25       typedef fpa::Filters::QueueAlgorithm< TDataInterface > Superclass;
26       typedef RegionGrow                                     Self;
27       typedef itk::SmartPointer< Self >                      Pointer;
28       typedef itk::SmartPointer< const Self >                ConstPointer;
29
30       typedef typename TDataInterface::TTraits TTraits;
31       fpaTraitsMacro( typename TTraits );
32
33       typedef itk::FunctionBase< TInputValue, bool >         TScalarPredicate;
34       typedef fpa::Functors::VertexFunction< TVertex, bool > TVertexPredicate;
35
36     public:
37       itkTypeMacro( fpa::Filters::RegionGrow, fpa::Filters::QueueAlgorithm );
38
39       itkGetConstObjectMacro( ScalarPredicate, TScalarPredicate );
40       itkGetObjectMacro( ScalarPredicate, TScalarPredicate );
41
42       itkGetConstObjectMacro( VertexPredicate, TVertexPredicate );
43       itkGetObjectMacro( VertexPredicate, TVertexPredicate );
44
45       itkGetConstMacro( InsideValue, TOutputValue );
46       itkSetMacro( InsideValue, TOutputValue );
47
48     public:
49       void SetPredicate( TScalarPredicate* p );
50       void SetPredicate( TVertexPredicate* p );
51
52       TOutputValue GetOutsideValue( ) const;
53       void SetOutsideValue( const TOutputValue& v );
54
55     protected:
56       RegionGrow( );
57       virtual ~RegionGrow( );
58
59       virtual void _PostComputeOutputValue( TNode& n ) override;
60       virtual void _PreComputeOutputValue( TNode& n ) override;
61
62     private:
63       RegionGrow( const Self& other );
64       Self& operator=( const Self& other );
65
66     protected:
67       typename TScalarPredicate::Pointer m_ScalarPredicate;
68       typename TVertexPredicate::Pointer m_VertexPredicate;
69
70       TOutputValue m_InsideValue;
71     };
72
73   } // ecapseman
74
75 } // ecapseman
76
77 #ifndef ITK_MANUAL_INSTANTIATION
78 #  include <fpa/Filters/RegionGrow.hxx>
79 #endif // ITK_MANUAL_INSTANTIATION
80 #endif // __fpa__Filters__RegionGrow__h__
81 // eof - $RCSfile$