]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Mon, 19 Jun 2017 04:35:04 +0000 (23:35 -0500)
committerLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Mon, 19 Jun 2017 04:35:04 +0000 (23:35 -0500)
lib/fpa/Image/SkeletonFilter.h
lib/fpa/Image/SkeletonFilter.hxx

index 296ac870cbc6d819a0f418ef2e9f3189edfbd853..11c2a74294abbb27ea7a3f58969ff09902669888 100644 (file)
@@ -6,22 +6,14 @@
 #ifndef __fpa__Image__SkeletonFilter__h__
 #define __fpa__Image__SkeletonFilter__h__
 
+#include <map>
+
 #include <itkProcessObject.h>
 #include <itkSignedMaurerDistanceMapImageFilter.h>
+
 #include <fpa/Image/Dijkstra.h>
 #include <fpa/Image/Skeleton.h>
 
-/*
-  #include <functional>
-  #include <map>
-
-
-  #include <fpa/Image/MinimumSpanningTree.h>
-
-  #include <itkMinimumMaximumImageCalculator.h>
-  #include <fpa/Image/Functors/Dijkstra/Invert.h>
-*/
-
 namespace fpa
 {
   namespace Image
index 0f33388f80d04b8202fa3791a787beb66531e4ba..50a035453cfd8660aec6cb4f6a2d19c485d0043e 100644 (file)
@@ -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
 }
 
 // -------------------------------------------------------------------------