]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/MinimumSpanningTree.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / MinimumSpanningTree.hxx
index 01c642d96f61860be178dbd1f734ff69453ea6e5..162526ce20f058d06e480750914a82ff290f0939 100644 (file)
@@ -21,38 +21,22 @@ SetParent( const TVertex& v, const TVertex& p )
 
 // -------------------------------------------------------------------------
 template< unsigned int _VDim >
-typename fpa::Image::MinimumSpanningTree< _VDim >::
-TPoints fpa::Image::MinimumSpanningTree< _VDim >::
-GetEuclideanPath( const TVertex& a ) const
+void fpa::Image::MinimumSpanningTree< _VDim >::
+GetPath( typename TPath::Pointer& path, const TVertex& a ) const
 {
-  TVertices path = this->GetPath( a );
-  TPoints points;
-  for( auto v = path.begin( ); v != path.end( ); ++v )
-  {
-    TPoint p;
-    this->TransformIndexToPhysicalPoint( *v, p );
-    points.push_back( p );
-
-  } // rof
-  return( points );
+  this->Superclass::GetPath( path, a );
+  path->SetReferenceImage( this );
 }
 
 // -------------------------------------------------------------------------
 template< unsigned int _VDim >
-typename fpa::Image::MinimumSpanningTree< _VDim >::
-TPoints fpa::Image::MinimumSpanningTree< _VDim >::
-GetEuclideanPath( const TVertex& a, const TVertex& b ) const
+void fpa::Image::MinimumSpanningTree< _VDim >::
+GetPath(
+  typename TPath::Pointer& path, const TVertex& a, const TVertex& b
+  ) const
 {
-  TVertices path = this->GetPath( a, b );
-  TPoints points;
-  for( auto v = path.begin( ); v != path.end( ); ++v )
-  {
-    TPoint p;
-    this->TransformIndexToPhysicalPoint( *v, p );
-    points.push_back( p );
-
-  } // rof
-  return( points );
+  this->Superclass::GetPath( path, a, b );
+  path->SetReferenceImage( this );
 }
 
 // -------------------------------------------------------------------------