]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Algorithm.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / Algorithm.hxx
index 98592f63d21c375268ff7d1e5fa68ae56f2dd550..0fce0d597c85d14e51aa516b883ee351a6b87df1 100644 (file)
@@ -64,7 +64,7 @@ _UnifySeeds( )
 {
   const TInputImage* input = this->GetInput( );
   typename TInputImage::RegionType region = input->GetRequestedRegion( );
-  TSeeds seeds = this->GetSeeds( );
+  TSeeds& seeds = this->GetSeeds( );
   TNodes nodes;
 
   typename TSeeds::iterator sIt = seeds.begin( );
@@ -80,12 +80,15 @@ _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
       sIt->IsUnified = false;
-      
+
   } // rof
 
   return( nodes );
@@ -178,7 +181,7 @@ _GetOutputValue( const TVertex& v ) const
 template< class _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
 void
 fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
-_UpdateOutputValue( const TNode& n )
+_UpdateOutputValue( TNode& n )
 {
   this->GetOutput( )->SetPixel( n.Vertex, n.Value );
 }
@@ -203,12 +206,11 @@ _GetMark( const TVertex& v ) const
 
 // -------------------------------------------------------------------------
 template< class _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
-bool
+void
 fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
 _Mark( const TVertex& v, unsigned long frontId )
 {
   this->GetMarks( )->SetPixel( v, TFrontId( frontId ) );
-  return( true );
 }
 
 #endif // __fpa__Image__Algorithm__hxx__