1 #ifndef __FPA__IMAGE__ALGORITHM__H__
2 #define __FPA__IMAGE__ALGORITHM__H__
11 * A generic front propagation algorithm were vertices are image pixels.
13 * @param I Input image type
14 * @param O Output image type
15 * @param A Base algorithm (RegionGrow, Dijkstra or FastMarching)
17 template< class I, class O, class A >
22 /// Standard class typdedefs
23 typedef Algorithm Self;
25 typedef itk::SmartPointer< Self > Pointer;
26 typedef itk::SmartPointer< const Self > ConstPointer;
28 /// Template input values
29 typedef I TInputImage;
30 typedef O TOutputImage;
32 typedef typename Superclass::TVertex TVertex;
33 typedef typename Superclass::TValue TValue;
34 typedef typename Superclass::TResult TResult;
35 typedef typename Superclass::TVertexCompare TVertexCompare;
36 typedef typename Superclass::TMinimumSpanningTree TMinimumSpanningTree;
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;
47 itkTypeMacro( Algorithm, TAlgorithm );
50 itkGetConstMacro( NeighborhoodOrder, unsigned int );
51 itkSetMacro( NeighborhoodOrder, unsigned int );
55 virtual ~Algorithm( );
57 virtual void _BeforeGenerateData( );
58 virtual void _AfterGenerateData( );
60 // Graph-related abstract methods
61 virtual unsigned long _NumberOfVertices( ) const;
62 virtual const TValue& _VertexValue( const TVertex& v ) const;
63 virtual double _Distance(
64 const TVertex& a, const TVertex& b
66 virtual bool _HasEdge( const TVertex& a, const TVertex& b ) const;
67 virtual void _Neighborhood(
68 _TVertices& neighborhood, const TVertex& v
71 // Results-related abstract methods
72 virtual void _InitResults( );
73 virtual const TResult& _Result( const TVertex& v ) const;
74 virtual void _SetResult( const TVertex& v, const _TNode& n );
77 // Purposely not implemented
78 Algorithm( const Self& other );
79 Self& operator=( const Self& other );
82 unsigned int m_NeighborhoodOrder;
89 #include <fpa/Image/Algorithm.hxx>
91 #endif // __FPA__IMAGE__ALGORITHM__H__