1 #ifndef __FPA__BASE__REGIONGROW__H__
2 #define __FPA__BASE__REGIONGROW__H__
5 #include <fpa/Base/Algorithm.h>
12 * Region grow is a front propagation with no costs.
14 * @param V Vertex type.
15 * @param C Vertex value type.
16 * @param R Result value type.
17 * @param B Base class for this algorithm. It should be any itk-based
18 * filter (itk::ProcessObject).
21 template< class V, class C, class R, class B >
23 : public Algorithm< V, C, R, B >
26 typedef RegionGrow Self;
27 typedef Algorithm< V, C, R, B > Superclass;
28 typedef itk::SmartPointer< Self > Pointer;
29 typedef itk::SmartPointer< const Self > ConstPointer;
31 typedef typename Superclass::TVertex TVertex;
32 typedef typename Superclass::TValue TValue;
33 typedef typename Superclass::TResult TResult;
36 typedef typename Superclass::_TVertices _TVertices;
37 typedef typename Superclass::_TCollision _TCollision;
38 typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
39 typedef typename Superclass::_TCollisions _TCollisions;
40 typedef typename Superclass::_TNode _TNode;
41 typedef typename Superclass::_TNodes _TNodes;
43 typedef std::queue< _TNode > _TQueue;
46 itkTypeMacro( RegionGrow, Algorithm );
48 itkGetConstMacro( InsideValue, TResult );
49 itkGetConstMacro( OutsideValue, TResult );
51 itkSetMacro( InsideValue, TResult );
52 itkSetMacro( OutsideValue, TResult );
56 virtual ~RegionGrow( );
58 virtual bool _CheckMembership( const TVertex& v ) const = 0;
60 // Results-related abstract methods
61 virtual bool _ComputeNeighborResult(
62 TResult& result, const TVertex& neighbor, const TVertex& parent
65 // Queue-related abstract methods
66 virtual bool _IsQueueEmpty( ) const;
67 virtual void _QueuePush( const _TNode& n );
68 virtual _TNode _QueuePop( );
69 virtual void _QueueClear( );
72 // Purposely not implemented
73 RegionGrow( const Self& other );
74 Self& operator=( const Self& other );
77 TResult m_InsideValue;
78 TResult m_OutsideValue;
86 #include <fpa/Base/RegionGrow.hxx>
88 #endif // __FPA__BASE__REGIONGROW__H__