auto vertex = qIt->second;
// 2.1. Check if the vertex has already been visited
- if( this->_Mark( vertex ) > 0 )
+ if( this->_Mark( vertex ) > 0 || this->_SkeletonMark( vertex ) > 0 )
continue;
// 2.2. Get path from front seed
bifurcations->Get( ).push_back( *pIt );
// Reorder labels
- auto coll_branch = this->m_Branches[ mark ];
- this->m_Branches[ mark ] = _TBranch( coll_branch.first, *pIt );
+ auto coll_branch = this->m_Branches[ mark - 1 ];
+ this->m_Branches[ mark - 1 ] = _TBranch( coll_branch.first, *pIt );
this->m_Branches[ label - 1 ] = _TBranch( qIt->second, *pIt );
this->m_Branches.push_back( _TBranch( *pIt, coll_branch.second ) );
pIt++;
} // elihw
+ if( pIt != path.end( ) )
+ this->_MarkSkeleton( *pIt, label );
// Force inner loop termination
pIt = path.end( );
} // rof
+ // Remove illegal branches
+ auto dIt = this->m_Branches.begin( );
+ while( dIt != this->m_Branches.end( ) )
+ {
+ if( dIt->first == dIt->second )
+ dIt = this->m_Branches.erase( dIt );
+ else
+ dIt++;
+
+ } // fi
+
+ // Finish
endpoints->SetReferenceImage( mst );
bifurcations->SetReferenceImage( mst );
collisions->SetReferenceImage( mst );