]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Dijkstra.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / Dijkstra.hxx
index 40058e16e215541709704f455bb03ebbc79b1d6c..be3598173de4c74d81334389ec930ff4b637b120 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,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
 }
 
 // -------------------------------------------------------------------------