]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Dijkstra.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / Dijkstra.hxx
index 40058e16e215541709704f455bb03ebbc79b1d6c..9de7912d2597427ed381279679432b659115f72a 100644 (file)
@@ -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,21 +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 );
+
+  const 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 );