From 9bcf7cb1dcbde2226e3908f4013eaccdad102db7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Thu, 22 Jun 2017 18:22:39 -0500 Subject: [PATCH] ... --- lib/fpa/Base/SeedsInterface.h | 6 +++++- lib/fpa/Image/Algorithm.hxx | 5 ++++- lib/fpa/Image/RandomWalker.hxx | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/fpa/Base/SeedsInterface.h b/lib/fpa/Base/SeedsInterface.h index 493b4db..41debde 100644 --- a/lib/fpa/Base/SeedsInterface.h +++ b/lib/fpa/Base/SeedsInterface.h @@ -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; diff --git a/lib/fpa/Image/Algorithm.hxx b/lib/fpa/Image/Algorithm.hxx index 98592f6..9ac7548 100644 --- a/lib/fpa/Image/Algorithm.hxx +++ b/lib/fpa/Image/Algorithm.hxx @@ -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 diff --git a/lib/fpa/Image/RandomWalker.hxx b/lib/fpa/Image/RandomWalker.hxx index acaa60a..5fb7768 100644 --- a/lib/fpa/Image/RandomWalker.hxx +++ b/lib/fpa/Image/RandomWalker.hxx @@ -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 -- 2.47.1