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 );
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::Image::MinimumSpanningTree< _VDim >::
45 GetPolyLineParametricPath(
46 typename TPolyLineParametricPath::Pointer& path,
47 const TVertex& a, const TVertex& b
50 TVertices v = this->GetPath( a, b );
51 path = TPolyLineParametricPath::New( );
52 path->SetReferenceImage( this );
53 typename TVertices::const_iterator vIt = v.begin( );
54 for( ; vIt != v.end( ); ++vIt )
55 path->AddVertex( *vIt );
58 // -------------------------------------------------------------------------
59 template< unsigned int _VDim >
60 fpa::Image::MinimumSpanningTree< _VDim >::
61 MinimumSpanningTree( )
66 // -------------------------------------------------------------------------
67 template< unsigned int _VDim >
68 fpa::Image::MinimumSpanningTree< _VDim >::
69 ~MinimumSpanningTree( )
73 #endif // __fpa__Image__MinimumSpanningTree__hxx__