1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__DataStructures__Image__MinimumSpanningTree__hxx__
6 #define __fpa__DataStructures__Image__MinimumSpanningTree__hxx__
8 // -------------------------------------------------------------------------
9 template< unsigned int _VDim >
10 typename fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
11 TVertex fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
12 GetParent( const TVertex& v ) const
14 return( v + this->GetPixel( v ) );
17 // -------------------------------------------------------------------------
18 template< unsigned int _VDim >
19 void fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
20 SetParent( const TVertex& v, const TVertex& p )
22 this->SetPixel( v, p - v );
25 // -------------------------------------------------------------------------
26 template< unsigned int _VDim >
27 void fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
28 GetPolyLineParametricPath(
29 typename TPolyLineParametricPath::Pointer& path,
33 TVertices v = this->GetPath( a );
35 path = TPolyLineParametricPath::New( );
36 path->SetReferenceImage( this );
37 typename TVertices::const_iterator vIt = v.begin( );
38 for( ; vIt != v.end( ); ++vIt )
39 path->AddVertex( *vIt );
42 // -------------------------------------------------------------------------
43 template< unsigned int _VDim >
44 void fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
45 GetPolyLineParametricPath(
46 typename TPolyLineParametricPath::Pointer& path,
47 const TVertex& a, const TVertex& b
50 TVertices v = this->GetPath( a, b );
52 path = TPolyLineParametricPath::New( );
53 path->SetReferenceImage( this );
54 typename TVertices::const_iterator vIt = v.begin( );
55 for( ; vIt != v.end( ); ++vIt )
56 path->AddVertex( *vIt );
59 // -------------------------------------------------------------------------
60 template< unsigned int _VDim >
61 fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
62 MinimumSpanningTree( )
67 // -------------------------------------------------------------------------
68 template< unsigned int _VDim >
69 fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
70 ~MinimumSpanningTree( )
74 #endif // __fpa__DataStructures__Image__MinimumSpanningTree__hxx__