1 #ifndef __FPA__BASE__MINIMUMSPANNINGTREE__H__
2 #define __FPA__BASE__MINIMUMSPANNINGTREE__H__
7 #include <itkSimpleDataObjectDecorator.h>
8 #include <itkSmartPointer.h>
16 template< class V, class C, class VC >
17 class MinimumSpanningTree
18 : public itk::SimpleDataObjectDecorator< std::map< V, std::pair< V, short >, VC > >
21 typedef std::pair< V, short > TNodeInfo;
22 typedef std::map< V, TNodeInfo, VC > TDecorated;
23 typedef MinimumSpanningTree Self;
24 typedef itk::SimpleDataObjectDecorator< TDecorated > Superclass;
25 typedef itk::SmartPointer< Self > Pointer;
26 typedef itk::SmartPointer< const Self > ConstPointer;
29 typedef C TCollisions;
30 typedef VC TVertexCompare;
33 typedef std::vector< unsigned long > _TRow;
34 typedef std::vector< _TRow > _TMatrix;
38 itkTypeMacro( MinimumSpanningTree, itkSimpleDataObjectDecorator );
40 itkGetConstMacro( Collisions, TCollisions );
43 void SetCollisions( const TCollisions& collisions );
44 void SetParent( const TVertex& v, const TVertex& p, const short& fid )
46 this->Get( )[ v ] = TNodeInfo( p, fid );
51 this->Get( ).clear( );
52 this->m_Collisions.clear( );
53 this->m_FrontPaths.clear( );
56 std::vector< V >& path, const V& a, const V& b
59 template< class I, class P >
60 void GetPathFromImage(
61 std::vector< P >& path, const V& a, const V& b,
62 const I* image, unsigned int kernel = 0
66 MinimumSpanningTree( );
67 virtual ~MinimumSpanningTree( );
69 virtual void _Path( std::vector< V >& path, const V& a ) const;
72 // Purposely not implemented
73 MinimumSpanningTree( const Self& other );
74 Self& operator=( const Self& other );
77 TCollisions m_Collisions;
78 _TMatrix m_FrontPaths;
79 static const unsigned long INF_VALUE;
86 #include <fpa/Base/MinimumSpanningTree.hxx>
88 #endif // __FPA__BASE__MINIMUMSPANNINGTREE__H__