]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Thu, 22 Jun 2017 23:22:39 +0000 (18:22 -0500)
committerLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Thu, 22 Jun 2017 23:22:39 +0000 (18:22 -0500)
lib/fpa/Base/SeedsInterface.h
lib/fpa/Image/Algorithm.hxx
lib/fpa/Image/RandomWalker.hxx

index 493b4dbfde30462c9902dde1a12f3a7dbb0e75b5..41debde26ae73c812224358b3c864ca825b699d8 100644 (file)
@@ -43,7 +43,11 @@ namespace fpa
         TPoint  Point;
         bool    IsPoint;
         bool    IsUnified;
-        TSeed( ) : IsUnified( false ) { }
+        TFrontId FrontId;
+        TSeed( )
+          : IsUnified( false ),
+            FrontId( TFrontId( 0 ) )
+          { }
       };
       typedef std::vector< TSeed > TSeeds;
 
index 98592f63d21c375268ff7d1e5fa68ae56f2dd550..9ac7548b55c2fbe729b2544f85795de31d541bb2 100644 (file)
@@ -80,7 +80,10 @@ _UnifySeeds( )
       sIt->IsUnified = true;
       node.Vertex = sIt->Vertex;
       node.Parent = node.Vertex;
-      node.FrontId = nodes.size( ) + 1;
+      if( sIt->FrontId == 0 )
+        node.FrontId = nodes.size( ) + 1;
+      else
+        node.FrontId = sIt->FrontId;
       nodes.insert( node );
     }
     else
index acaa60ab8118e40510e6e509d9b97b63ec617ac6..5fb77681d925dd0a3c7b6b92072094de2fbaf6ac 100644 (file)
@@ -114,6 +114,7 @@ _UnifySeeds( )
         typename TSeedsInterface::TSeed seed;
         seed.Vertex = lIt.GetIndex( );
         seed.IsPoint = false;
+        seed.FrontId = lIt.Get( );
         this->m_Seeds.push_back( seed );
 
       } // fi