]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Algorithm.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / Algorithm.hxx
index 0d83b035e6f821ccb52fe9d3bc0a843f0c72ebe7..5e8605dcdd04f117c077169a3852a457f5e87945 100644 (file)
@@ -29,6 +29,15 @@ _BeforeGenerateData( )
   this->AllocateOutputs( );
 }
 
+// -------------------------------------------------------------------------
+template< class I, class O, class A >
+void fpa::Image::Algorithm< I, O, A >::
+_AfterGenerateData( )
+{
+  this->Superclass::_AfterGenerateData( );
+  this->GetMinimumSpanningTree( )->SetCollisions( this->m_Collisions );
+}
+
 // -------------------------------------------------------------------------
 template< class I, class O, class A >
 unsigned long fpa::Image::Algorithm< I, O, A >::
@@ -134,47 +143,10 @@ _Result( const TVertex& v ) const
 // -------------------------------------------------------------------------
 template< class I, class O, class A >
 void fpa::Image::Algorithm< I, O, A >::
-_SetResult( const TVertex& v, const TResult& r )
-{
-  this->GetOutput( )->SetPixel( v, r );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O, class A >
-const typename fpa::Image::Algorithm< I, O, A >::
-_TNode& fpa::Image::Algorithm< I, O, A >::
-_Node( const TVertex& v ) const
-{
-  return( this->m_Marks->GetPixel( v ) );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O, class A >
-void fpa::Image::Algorithm< I, O, A >::
-_InitMarks( )
-{
-  const I* in = this->GetInput( );
-
-  this->m_Marks = _TMarks::New( );
-  this->m_Marks->SetLargestPossibleRegion( in->GetLargestPossibleRegion( ) );
-  this->m_Marks->SetRequestedRegion( in->GetRequestedRegion( ) );
-  this->m_Marks->SetBufferedRegion( in->GetBufferedRegion( ) );
-  this->m_Marks->SetOrigin( in->GetOrigin( ) );
-  this->m_Marks->SetSpacing( in->GetSpacing( ) );
-  this->m_Marks->SetDirection( in->GetDirection( ) );
-  this->m_Marks->Allocate( );
-
-  _TNode far_node;
-  far_node.Label = Self::FarLabel;
-  this->m_Marks->FillBuffer( far_node );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O, class A >
-void fpa::Image::Algorithm< I, O, A >::
-_Mark( const _TNode& node )
+_SetResult( const TVertex& v, const _TNode& n )
 {
-  this->m_Marks->SetPixel( node.Vertex, node );
+  this->GetOutput( )->SetPixel( v, n.Result );
+  this->GetMinimumSpanningTree( )->SetParent( v, n.Parent, n.FrontId );
 }
 
 #endif // __FPA__IMAGE__ALGORITHM__HXX__