1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__DataStructures__MinimumSpanningTree__h__
6 #define __fpa__DataStructures__MinimumSpanningTree__h__
12 namespace DataStructures
16 template< class _TVertex, class _Superclass >
17 class MinimumSpanningTree
21 typedef MinimumSpanningTree Self;
22 typedef _Superclass Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
26 typedef _TVertex TVertex;
27 typedef std::pair< TVertex, bool > TCollision;
28 typedef std::vector< TCollision > TCollisionsRow;
29 typedef std::vector< TCollisionsRow > TCollisions;
30 typedef std::vector< TVertex > TVertices;
33 typedef std::vector< unsigned long > _TRow;
34 typedef std::vector< _TRow > _TMatrix;
37 itkTypeMacro( fpa::Base::MinimumSpanningTree, _Superclass );
40 const TCollisions& GetCollisions( ) const;
41 void SetCollisions( const TCollisions& collisions );
44 void AddSeed( const TVertex& seed, unsigned long fId );
46 virtual TVertex GetParent( const TVertex& v ) const = 0;
47 virtual void SetParent( const TVertex& v, const TVertex& p ) = 0;
49 virtual TVertices GetAxis( const TVertex& a ) const;
50 virtual TVertices GetAxis( const TVertex& a, const TVertex& b ) const;
53 MinimumSpanningTree( );
54 virtual ~MinimumSpanningTree( );
57 MinimumSpanningTree( const Self& other );
58 Self& operator=( const Self& other );
61 TCollisions m_Collisions;
62 _TMatrix m_FrontPaths;
63 std::vector< TVertex > m_Seeds;
70 #ifndef ITK_MANUAL_INSTANTIATION
71 # include <fpa/DataStructures/MinimumSpanningTree.hxx>
72 #endif // ITK_MANUAL_INSTANTIATION
73 #endif // __fpa__DataStructures__MinimumSpanningTree__h__