]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/MinimumSpanningTree.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / MinimumSpanningTree.hxx
index 162526ce20f058d06e480750914a82ff290f0939..b99953b28ed029636ab4c3fddca40bf6429038f1 100644 (file)
@@ -24,8 +24,10 @@ template< unsigned int _VDim >
 void fpa::Image::MinimumSpanningTree< _VDim >::
 GetPath( typename TPath::Pointer& path, const TVertex& a ) const
 {
-  this->Superclass::GetPath( path, a );
+  if( path.GetPointer( ) == NULL )
+    path = TPath::New( );
   path->SetReferenceImage( this );
+  this->Superclass::GetPath( path, a );
 }
 
 // -------------------------------------------------------------------------
@@ -35,8 +37,10 @@ GetPath(
   typename TPath::Pointer& path, const TVertex& a, const TVertex& b
   ) const
 {
-  this->Superclass::GetPath( path, a, b );
+  if( path.GetPointer( ) == NULL )
+    path = TPath::New( );
   path->SetReferenceImage( this );
+  this->Superclass::GetPath( path, a, b );
 }
 
 // -------------------------------------------------------------------------