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 GetPath( typename TPath::Pointer& path, const TVertex& a ) const
30 TVertices v = this->GetAxis( a );
33 path->SetReferenceImage( this );
34 typename TVertices::const_iterator vIt = v.begin( );
35 for( ; vIt != v.end( ); ++vIt )
36 path->AddVertex( *vIt );
39 // -------------------------------------------------------------------------
40 template< unsigned int _VDim >
41 void fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
43 typename TPath::Pointer& path, const TVertex& a, const TVertex& b
46 TVertices v = this->GetAxis( a, b );
49 path->SetReferenceImage( this );
50 typename TVertices::const_iterator vIt = v.begin( );
51 for( ; vIt != v.end( ); ++vIt )
52 path->AddVertex( *vIt );
55 // -------------------------------------------------------------------------
56 template< unsigned int _VDim >
57 fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
58 MinimumSpanningTree( )
63 // -------------------------------------------------------------------------
64 template< unsigned int _VDim >
65 fpa::DataStructures::Image::MinimumSpanningTree< _VDim >::
66 ~MinimumSpanningTree( )
70 #endif // __fpa__DataStructures__Image__MinimumSpanningTree__hxx__