From 5452f231f7c3876dab40ed21d860e0077d0b9469 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Sun, 18 Jun 2017 23:35:04 -0500 Subject: [PATCH] ... --- lib/fpa/Image/SkeletonFilter.h | 14 +++----------- lib/fpa/Image/SkeletonFilter.hxx | 28 ++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/lib/fpa/Image/SkeletonFilter.h b/lib/fpa/Image/SkeletonFilter.h index 296ac87..11c2a74 100644 --- a/lib/fpa/Image/SkeletonFilter.h +++ b/lib/fpa/Image/SkeletonFilter.h @@ -6,22 +6,14 @@ #ifndef __fpa__Image__SkeletonFilter__h__ #define __fpa__Image__SkeletonFilter__h__ +#include + #include #include + #include #include -/* - #include - #include - - - #include - - #include - #include -*/ - namespace fpa { namespace Image diff --git a/lib/fpa/Image/SkeletonFilter.hxx b/lib/fpa/Image/SkeletonFilter.hxx index 0f33388..50a0354 100644 --- a/lib/fpa/Image/SkeletonFilter.hxx +++ b/lib/fpa/Image/SkeletonFilter.hxx @@ -167,13 +167,33 @@ GenerateData( ) dijkstra->Update( ); // Compute end-points + const _TMST* mst = dijkstra->GetMinimumSpanningTree( ); std::vector< TIndex > end_points; this->_EndPoints( - end_points, - this->m_DistanceMap->GetOutput( ), - dijkstra->GetMinimumSpanningTree( ), - dijkstra->GetSkeletonQueue( ) + end_points, this->m_DistanceMap->GetOutput( ), + mst, dijkstra->GetSkeletonQueue( ) ); + + // Create branches + TSkeleton* sk = this->GetOutput( ); + typename std::vector< TIndex >::const_iterator eIt = end_points.begin( ); + std::map< TIndex, unsigned long, typename TIndex::LexicographicCompare > tags; + unsigned long t = 1; + for( ; eIt != end_points.end( ); ++eIt ) + { + // Tag path + TIndex it = *eIt; + TIndex p = mst->GetParent( it ); + while( it != p ) + { + tags[ it ] = t; + it = p; + p = mst->GetParent( it ); + + } // elihw + // TODO: More on it + + } // rof } // ------------------------------------------------------------------------- -- 2.47.1