1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__MinimumSpanningTree__h__
7 #define __fpa__Base__MinimumSpanningTree__h__
17 template< class _TVertex, class _Superclass >
18 class MinimumSpanningTree
22 typedef MinimumSpanningTree Self;
23 typedef _Superclass Superclass;
24 typedef itk::SmartPointer< Self > Pointer;
25 typedef itk::SmartPointer< const Self > ConstPointer;
27 typedef _TVertex TVertex;
28 typedef std::pair< TVertex, bool > TCollision;
29 typedef std::vector< TCollision > TCollisionsRow;
30 typedef std::vector< TCollisionsRow > TCollisions;
31 typedef std::vector< TVertex > TVertices;
34 typedef std::vector< unsigned long > _TRow;
35 typedef std::vector< _TRow > _TMatrix;
38 itkTypeMacro( fpa::Base::MinimumSpanningTree, _Superclass );
41 const TCollisions& GetCollisions( ) const;
42 void SetCollisions( const TCollisions& collisions );
45 void AddSeed( const TVertex& seed );
47 virtual TVertex GetParent( const TVertex& v ) const = 0;
48 virtual void SetParent( const TVertex& v, const TVertex& p ) = 0;
50 virtual TVertices GetPath( const TVertex& a ) const;
51 virtual TVertices GetPath( const TVertex& a, const TVertex& b ) const;
54 MinimumSpanningTree( );
55 virtual ~MinimumSpanningTree( );
58 MinimumSpanningTree( const Self& other );
59 Self& operator=( const Self& other );
62 TCollisions m_Collisions;
63 _TMatrix m_FrontPaths;
64 std::vector< TVertex > m_Seeds;
71 #ifndef ITK_MANUAL_INSTANTIATION
72 # include <fpa/Base/MinimumSpanningTree.hxx>
73 #endif // ITK_MANUAL_INSTANTIATION
75 #endif // __fpa__Base__MinimumSpanningTree__h__