X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FSkeletonFilter.hxx;h=50a035453cfd8660aec6cb4f6a2d19c485d0043e;hb=5452f231f7c3876dab40ed21d860e0077d0b9469;hp=0f33388f80d04b8202fa3791a787beb66531e4ba;hpb=3a438326c6901fafd9be8b5446a828aa5f63a1cc;p=FrontAlgorithms.git 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 } // -------------------------------------------------------------------------