X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ffpa%2FImage%2FMinimumSpanningTree.hxx;h=b99953b28ed029636ab4c3fddca40bf6429038f1;hb=86a6d5df2aa1aa5292a5fa851d98bfc13939bdf3;hp=162526ce20f058d06e480750914a82ff290f0939;hpb=203ea510f7cc3990e606dd93a97dd0b5075d35c4;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/MinimumSpanningTree.hxx b/lib/fpa/Image/MinimumSpanningTree.hxx index 162526c..b99953b 100644 --- a/lib/fpa/Image/MinimumSpanningTree.hxx +++ b/lib/fpa/Image/MinimumSpanningTree.hxx @@ -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 ); } // -------------------------------------------------------------------------