]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.hxx
index 3e8b6e591dc33fb916a1e22f849ddbeeb8af2bbf..afb5252f43c693f5e08644a9213dc3634ad38369 100644 (file)
@@ -65,19 +65,6 @@ GetCollisions( )
     );
 }
 
-// -------------------------------------------------------------------------
-template< class _TMST >
-typename
-fpa::Base::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree< _TMST >::
-TBranches*
-fpa::Base::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree< _TMST >::
-GetBranches( )
-{
-  return(
-    dynamic_cast< TBranches* >( this->itk::ProcessObject::GetOutput( 3 ) )
-    );
-}
-
 // -------------------------------------------------------------------------
 template< class _TMST >
 fpa::Base::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree< _TMST >::
@@ -89,11 +76,9 @@ ExtractEndPointsAndBifurcationsFromMinimumSpanningTree( )
   typename TVertices::Pointer ep = TVertices::New( );
   typename TVertices::Pointer bf = TVertices::New( );
   typename TVertices::Pointer co = TVertices::New( );
-  typename TBranches::Pointer br = TBranches::New( );
   this->itk::ProcessObject::SetNthOutput( 0, ep.GetPointer( ) );
   this->itk::ProcessObject::SetNthOutput( 1, bf.GetPointer( ) );
   this->itk::ProcessObject::SetNthOutput( 2, co.GetPointer( ) );
-  this->itk::ProcessObject::SetNthOutput( 3, br.GetPointer( ) );
 }
 
 // -------------------------------------------------------------------------
@@ -119,11 +104,10 @@ GenerateData( )
   auto endpoints = this->GetEndPoints( );
   auto bifurcations = this->GetBifurcations( );
   auto collisions = this->GetCollisions( );
-  auto branches = this->GetBranches( );
   endpoints->Get( ).clear( );
   bifurcations->Get( ).clear( );
   collisions->Get( ).clear( );
-  branches->Get( ).clear( );
+  this->m_Branches.clear( );
 
   // 1. Get priority queue
   auto& q = mst->GetNodeQueue( );
@@ -144,7 +128,7 @@ GenerateData( )
 
     // 2.3. Prepare new branch data and prepare new end-point
     label++;
-    branches->Get( ).push_back( _TBranch( vertex, vertex ) );
+    this->m_Branches.push_back( _TBranch( vertex, vertex ) );
     endpoints->Get( ).push_back( vertex );
 
     // 2.4. Backtracking
@@ -160,10 +144,10 @@ GenerateData( )
         bifurcations->Get( ).push_back( *pIt );
 
         // Reorder labels
-        auto coll_branch = branches->Get( )[ mark ];
-        branches->Get( )[ mark  ] = _TBranch( coll_branch.first, *pIt );
-        branches->Get( )[ label - 1 ] = _TBranch( qIt->second, *pIt );
-        branches->Get( ).push_back( _TBranch( *pIt, coll_branch.second ) );
+        auto coll_branch = this->m_Branches[ mark ];
+        this->m_Branches[ mark  ] = _TBranch( coll_branch.first, *pIt );
+        this->m_Branches[ label - 1 ] = _TBranch( qIt->second, *pIt );
+        this->m_Branches.push_back( _TBranch( *pIt, coll_branch.second ) );
 
         // Mark skeleton (b,coll_branch_second) with the new label
         label++;
@@ -195,7 +179,7 @@ GenerateData( )
             double r = this->_Radius( *pIt );
             this->_MarkSkeleton( *pIt, label );
             this->_MarkSphere( *pIt, r, label );
-            branches->Get( )[ label - 1 ].second = *pIt;
+            this->m_Branches[ label - 1 ].second = *pIt;
 
             // 2.4.4. Is this a seed? -> add it to endpoints
             auto sIt = pIt;