X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FDijkstra.hxx;h=be3598173de4c74d81334389ec930ff4b637b120;hb=fe01e92d9bce3519fa2a0936b6180ca7b057a87a;hp=40058e16e215541709704f455bb03ebbc79b1d6c;hpb=c4efafee513539e9a58c4a8b8369450ada1df5d8;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/Dijkstra.hxx b/lib/fpa/Base/Dijkstra.hxx index 40058e1..be35981 100644 --- a/lib/fpa/Base/Dijkstra.hxx +++ b/lib/fpa/Base/Dijkstra.hxx @@ -12,8 +12,10 @@ typename fpa::Base::Dijkstra< _TAlgorithm, _TMST >:: TMST* fpa::Base::Dijkstra< _TAlgorithm, _TMST >:: GetMinimumSpanningTree( ) { - dynamic_cast< TMST* >( - this->itk::ProcessObject::GetOutput( this->m_MSTIdx ) + return( + dynamic_cast< TMST* >( + this->itk::ProcessObject::GetOutput( this->m_MSTIdx ) + ) ); } @@ -23,8 +25,10 @@ const typename fpa::Base::Dijkstra< _TAlgorithm, _TMST >:: TMST* fpa::Base::Dijkstra< _TAlgorithm, _TMST >:: GetMinimumSpanningTree( ) const { - dynamic_cast< const TMST* >( - this->itk::ProcessObject::GetOutput( this->m_MSTIdx ) + return( + dynamic_cast< const TMST* >( + this->itk::ProcessObject::GetOutput( this->m_MSTIdx ) + ) ); } @@ -51,15 +55,20 @@ template< class _TAlgorithm, class _TMST > void fpa::Base::Dijkstra< _TAlgorithm, _TMST >:: _AfterGenerateData( ) { - typedef typename Superclass::TSeedsInterface::TSeeds::iterator _TIt; - this->Superclass::_AfterGenerateData( ); TMST* mst = this->GetMinimumSpanningTree( ); mst->ClearSeeds( ); mst->SetCollisions( this->m_Collisions ); - for( _TIt sIt = this->BeginSeeds( ); sIt != this->EndSeeds( ); ++sIt ) - mst->AddSeed( sIt->Vertex ); + + TSeeds seeds = this->GetSeeds( ); + typename TSeeds::const_iterator sIt = seeds.begin( ); + for( ; sIt != seeds.end( ); ++sIt ) + { + if( sIt->IsUnified ) + mst->AddSeed( sIt->Vertex ); + + } // rof } // -------------------------------------------------------------------------