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::TSpace TSpace;
36 typedef typename Superclass::TVertexCompare TVertexCompare;
37 typedef typename Superclass::TMinimumSpanningTree TMinimumSpanningTree;
40 typedef typename Superclass::_TVertices _TVertices;
41 typedef typename Superclass::_TCollision _TCollision;
42 typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
43 typedef typename Superclass::_TCollisions _TCollisions;
44 typedef typename Superclass::_TNode _TNode;
45 typedef typename Superclass::_TNodes _TNodes;
48 itkTypeMacro( Algorithm, TAlgorithm );
51 itkGetConstMacro( NeighborhoodOrder, unsigned int );
52 itkSetMacro( NeighborhoodOrder, unsigned int );
56 virtual ~Algorithm( );
58 virtual void _BeforeGenerateData( );
59 virtual void _AfterGenerateData( );
61 // Graph-related abstract methods
62 virtual unsigned long _NumberOfVertices( ) const;
63 virtual const TValue& _VertexValue( const TVertex& v ) const;
64 virtual double _Distance(
65 const TVertex& a, const TVertex& b
67 virtual bool _HasEdge( const TVertex& a, const TVertex& b ) const;
68 virtual void _Neighborhood(
69 _TVertices& neighborhood, const TVertex& v
72 // Results-related abstract methods
73 virtual void _InitResults( );
74 virtual const TResult& _Result( const TVertex& v ) const;
75 virtual void _SetResult( const TVertex& v, const _TNode& n );
78 // Purposely not implemented
79 Algorithm( const Self& other );
80 Self& operator=( const Self& other );
83 unsigned int m_NeighborhoodOrder;
90 #include <fpa/Image/Algorithm.hxx>
92 #endif // __FPA__IMAGE__ALGORITHM__H__