X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FDijkstra.hxx;h=85380aa8a127de82828aadaf25c3111a459b4aeb;hb=5c78aecb0f5a207ff020e24f99d1e9bd8c388ad1;hp=93a102d2148729b8ca3aaf0af6a5fb99d1d3f17e;hpb=3a438326c6901fafd9be8b5446a828aa5f63a1cc;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/Dijkstra.hxx b/lib/fpa/Base/Dijkstra.hxx index 93a102d..85380aa 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,19 +55,26 @@ 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 } // ------------------------------------------------------------------------- template< class _TAlgorithm, class _TMST > void fpa::Base::Dijkstra< _TAlgorithm, _TMST >:: -_UpdateOutputValue( const TNode& n ) +_UpdateOutputValue( TNode& n ) { this->Superclass::_UpdateOutputValue( n ); this->GetMinimumSpanningTree( )->SetParent( n.Vertex, n.Parent );