]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 11 Oct 2016 01:31:48 +0000 (20:31 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 11 Oct 2016 01:31:48 +0000 (20:31 -0500)
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 );
 }
 
 // -------------------------------------------------------------------------