]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/MinimumSpanningTree.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / MinimumSpanningTree.hxx
1 #ifndef __fpa__Image__MinimumSpanningTree__hxx__
2 #define __fpa__Image__MinimumSpanningTree__hxx__
3
4 // -------------------------------------------------------------------------
5 template< unsigned int _VDim >
6 typename fpa::Image::MinimumSpanningTree< _VDim >::
7 TVertex fpa::Image::MinimumSpanningTree< _VDim >::
8 GetParent( const TVertex& v ) const
9 {
10   TVertex p = v + this->GetPixel( v );
11   return( p );
12 }
13
14 // -------------------------------------------------------------------------
15 template< unsigned int _VDim >
16 void fpa::Image::MinimumSpanningTree< _VDim >::
17 SetParent( const TVertex& v, const TVertex& p )
18 {
19   this->SetPixel( v, p - v );
20 }
21
22 // -------------------------------------------------------------------------
23 template< unsigned int _VDim >
24 void fpa::Image::MinimumSpanningTree< _VDim >::
25 GetPath( typename TPath::Pointer& path, const TVertex& a ) const
26 {
27   if( path.GetPointer( ) == NULL )
28     path = TPath::New( );
29   path->SetReferenceImage( this );
30   this->Superclass::GetPath( path, a );
31 }
32
33 // -------------------------------------------------------------------------
34 template< unsigned int _VDim >
35 void fpa::Image::MinimumSpanningTree< _VDim >::
36 GetPath(
37   typename TPath::Pointer& path, const TVertex& a, const TVertex& b
38   ) const
39 {
40   if( path.GetPointer( ) == NULL )
41     path = TPath::New( );
42   path->SetReferenceImage( this );
43   this->Superclass::GetPath( path, a, b );
44 }
45
46 // -------------------------------------------------------------------------
47 template< unsigned int _VDim >
48 fpa::Image::MinimumSpanningTree< _VDim >::
49 MinimumSpanningTree( )
50   : Superclass( )
51 {
52 }
53
54 // -------------------------------------------------------------------------
55 template< unsigned int _VDim >
56 fpa::Image::MinimumSpanningTree< _VDim >::
57 ~MinimumSpanningTree( )
58 {
59 }
60
61 #endif // __fpa__Image__MinimumSpanningTree__hxx__
62
63 // eof - $RCSfile$