]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/DataStructures/Skeleton.hxx
Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/cpPlugins
[cpPlugins.git] / lib / cpExtensions / DataStructures / Skeleton.hxx
index e6635ae25c38c169e980bf854d22489757ce6600..12f463f3796055dd017ac03255623102e5e5839c 100644 (file)
@@ -38,6 +38,42 @@ GetBranch( const TIndex& a, const TIndex& b ) const
     return( null_path );
 }
 
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex >
+cpExtensions::DataStructures::Skeleton< _VDim >::
+GetEndPoints( ) const
+{
+  std::vector< TIndex > res;
+  auto mIt = this->BeginEdgesRows( );
+  for( ; mIt != this->EndEdgesRows( ); ++mIt )
+  {
+    unsigned long count = mIt->second.size( );
+    if( count == 1 )
+      res.push_back( mIt->first );
+
+  } // rof
+  return( res );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex >
+cpExtensions::DataStructures::Skeleton< _VDim >::
+GetBifurcations( ) const
+{
+  std::vector< TIndex > res;
+  auto mIt = this->BeginEdgesRows( );
+  for( ; mIt != this->EndEdgesRows( ); ++mIt )
+  {
+    unsigned long count = mIt->second.size( );
+    if( count > 1 )
+      res.push_back( mIt->first );
+
+  } // rof
+  return( res );
+}
+
 // -------------------------------------------------------------------------
 template< unsigned int _VDim >
 cpExtensions::DataStructures::Skeleton< _VDim >::