1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__MinimumSpanningTree__hxx__
7 #define __fpa__Image__MinimumSpanningTree__hxx__
9 // -------------------------------------------------------------------------
10 template< unsigned int _VDim >
11 typename fpa::Image::MinimumSpanningTree< _VDim >::
12 TVertex fpa::Image::MinimumSpanningTree< _VDim >::
13 GetParent( const TVertex& v ) const
15 return( v + this->GetPixel( v ) );
18 // -------------------------------------------------------------------------
19 template< unsigned int _VDim >
20 void fpa::Image::MinimumSpanningTree< _VDim >::
21 SetParent( const TVertex& v, const TVertex& p )
23 this->SetPixel( v, p - v );
26 // -------------------------------------------------------------------------
27 template< unsigned int _VDim >
28 void fpa::Image::MinimumSpanningTree< _VDim >::
29 GetPolyLineParametricPath(
30 typename TPolyLineParametricPath::Pointer& path,
34 TVertices v = this->GetPath( a );
36 path = TPolyLineParametricPath::New( );
37 path->SetReferenceImage( this );
38 typename TVertices::const_iterator vIt = v.begin( );
39 for( ; vIt != v.end( ); ++vIt )
40 path->AddVertex( *vIt );
43 // -------------------------------------------------------------------------
44 template< unsigned int _VDim >
45 void fpa::Image::MinimumSpanningTree< _VDim >::
46 GetPolyLineParametricPath(
47 typename TPolyLineParametricPath::Pointer& path,
48 const TVertex& a, const TVertex& b
51 TVertices v = this->GetPath( a, b );
53 path = TPolyLineParametricPath::New( );
54 path->SetReferenceImage( this );
55 typename TVertices::const_iterator vIt = v.begin( );
56 for( ; vIt != v.end( ); ++vIt )
57 path->AddVertex( *vIt );
60 // -------------------------------------------------------------------------
61 template< unsigned int _VDim >
62 fpa::Image::MinimumSpanningTree< _VDim >::
63 MinimumSpanningTree( )
68 // -------------------------------------------------------------------------
69 template< unsigned int _VDim >
70 fpa::Image::MinimumSpanningTree< _VDim >::
71 ~MinimumSpanningTree( )
75 #endif // __fpa__Image__MinimumSpanningTree__hxx__