1 #ifndef __FPA__BASE__REGIONGROW__H__
2 #define __FPA__BASE__REGIONGROW__H__
6 #include <fpa/Base/Algorithm.h>
13 * Region grow is a front propagation with no costs.
15 * @param V Vertex type.
16 * @param C Vertex value type.
17 * @param R Result value type.
18 * @param VC Vertex lexicographical compare.
19 * @param B Base class for this algorithm. It should be any itk-based
20 * filter (itk::ProcessObject).
23 template< class V, class C, class R, class VC, class B >
25 : public Algorithm< V, C, R, VC, B >
28 typedef RegionGrow Self;
29 typedef Algorithm< V, C, R, VC, B > Superclass;
30 typedef itk::SmartPointer< Self > Pointer;
31 typedef itk::SmartPointer< const Self > ConstPointer;
33 typedef typename Superclass::TVertex TVertex;
34 typedef typename Superclass::TValue TValue;
35 typedef typename Superclass::TResult TResult;
36 typedef typename Superclass::TVertexCompare TVertexCompare;
39 typedef typename Superclass::_TVertices _TVertices;
40 typedef typename Superclass::_TCollision _TCollision;
41 typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
42 typedef typename Superclass::_TCollisions _TCollisions;
43 typedef typename Superclass::_TNode _TNode;
44 typedef typename Superclass::_TNodes _TNodes;
46 typedef std::queue< std::pair< TVertex, _TNode > > _TQueue;
49 itkTypeMacro( RegionGrow, Algorithm );
51 itkGetConstMacro( InsideValue, TResult );
52 itkGetConstMacro( OutsideValue, TResult );
54 itkSetMacro( InsideValue, TResult );
55 itkSetMacro( OutsideValue, TResult );
59 virtual ~RegionGrow( );
61 virtual bool _CheckMembership( const TVertex& v ) const = 0;
63 // Results-related abstract methods
64 virtual bool _ComputeNeighborResult(
65 TResult& result, const TVertex& neighbor, const TVertex& parent
68 // Queue-related abstract methods
69 virtual bool _IsQueueEmpty( ) const;
70 virtual void _QueuePush( const TVertex& v, const _TNode& n );
71 virtual void _QueuePop( TVertex& v, _TNode& n );
72 virtual void _QueueClear( );
75 // Purposely not implemented
76 RegionGrow( const Self& other );
77 Self& operator=( const Self& other );
80 TResult m_InsideValue;
81 TResult m_OutsideValue;
89 #include <fpa/Base/RegionGrow.hxx>
91 #endif // __FPA__BASE__REGIONGROW__H__