1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__RegionGrow__h__
7 #define __fpa__Base__RegionGrow__h__
10 #include <fpa/Config.h>
11 #include <itkConceptChecking.h>
12 #include <itkFunctionBase.h>
20 template< class _TAlgorithm >
25 typedef RegionGrow Self;
26 typedef _TAlgorithm Superclass;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef typename _TAlgorithm::TTraits TTraits;
31 fpa_Base_TraitTypes( typename TTraits );
33 typedef typename _TAlgorithm::TNode TNode;
34 typedef typename _TAlgorithm::TNodes TNodes;
35 typedef typename _TAlgorithm::TInputValue TInputValue;
36 typedef typename _TAlgorithm::TOutputValue TOutputValue;
37 typedef typename _TAlgorithm::TFrontId TFrontId;
38 typedef typename _TAlgorithm::TVertex TVertex;
41 typedef std::deque< TNode > TQueue;
42 typedef itk::FunctionBase< TInputValue, bool > TValuePredicate;
43 typedef itk::FunctionBase< TVertex, bool > TVertexPredicate;
48 ( itk::Concept::IsUnsignedInteger< TOutputValue > )
53 itkGetObjectMacro( ValuePredicate, TValuePredicate );
54 itkGetObjectMacro( VertexPredicate, TVertexPredicate );
56 itkGetConstMacro( InsideValue, TOutputValue );
57 itkSetMacro( InsideValue, TOutputValue );
60 virtual itk::ModifiedTimeType GetMTime( ) const override;
61 virtual TOutputValue GetOutsideValue( ) const;
62 virtual void SetOutsideValue( const TOutputValue& v );
64 void SetPredicate( TValuePredicate* p );
65 void SetPredicate( TVertexPredicate* p );
69 virtual ~RegionGrow( );
71 virtual void _ComputeOutputValue( TNode& n ) override;
72 virtual void _UpdateOutputValue( TNode& n ) override;
73 virtual void _QueueClear( ) override;
74 virtual TNode _QueuePop( ) override;
75 virtual void _QueuePush( const TNode& node ) override;
76 virtual unsigned long _QueueSize( ) const override;
77 virtual void _PrepareSeeds( TNodes& nodes ) override;
80 // Purposely not implemented.
81 RegionGrow( const Self& other );
82 Self& operator=( const Self& other );
85 typename TValuePredicate::Pointer m_ValuePredicate;
86 typename TVertexPredicate::Pointer m_VertexPredicate;
88 TOutputValue m_InsideValue;
97 #ifndef ITK_MANUAL_INSTANTIATION
98 # include <fpa/Base/RegionGrow.hxx>
99 #endif // ITK_MANUAL_INSTANTIATION
101 #endif // __fpa__Base__RegionGrow__h__