]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Algorithm.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / Algorithm.hxx
index a5b1f8548e5e4dd481a93eb1fbb3e3f6561d4ff4..5e8605dcdd04f117c077169a3852a457f5e87945 100644 (file)
@@ -4,42 +4,6 @@
 #include <cmath>
 #include <itkConstNeighborhoodIterator.h>
 
-// -------------------------------------------------------------------------
-template< class I, class O, class A >
-typename fpa::Image::Algorithm< I, O, A >::
-TMinimumSpanningTree* fpa::Image::Algorithm< I, O, A >::
-GetMinimumSpanningTree( )
-{
-  return(
-    dynamic_cast< TMinimumSpanningTree* >(
-      this->itk::ProcessObject::GetOutput( 1 )
-      )
-    );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O, class A >
-const typename fpa::Image::Algorithm< I, O, A >::
-TMinimumSpanningTree* fpa::Image::Algorithm< I, O, A >::
-GetMinimumSpanningTree( ) const
-{
-  return(
-    dynamic_cast< const TMinimumSpanningTree* >(
-      this->itk::ProcessObject::GetOutput( 1 )
-      )
-    );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O, class A >
-void fpa::Image::Algorithm< I, O, A >::
-GraftMinimumSpanningTree( itk::DataObject* obj )
-{
-  TMinimumSpanningTree* mst = dynamic_cast< TMinimumSpanningTree* >( obj );
-  if( mst != NULL )
-    this->GraftNthOutput( 1, mst );
-}
-
 // -------------------------------------------------------------------------
 template< class I, class O, class A >
 fpa::Image::Algorithm< I, O, A >::
@@ -47,9 +11,6 @@ Algorithm( )
   : Superclass( ),
     m_NeighborhoodOrder( 1 )
 {
-  this->itk::ProcessObject::SetNumberOfRequiredOutputs( 2 );
-  this->itk::ProcessObject::SetNthOutput( 0, O::New( ) );
-  this->itk::ProcessObject::SetNthOutput( 1, TMinimumSpanningTree::New( ) );
 }
 
 // -------------------------------------------------------------------------
@@ -182,36 +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->GetMinimumSpanningTree( )->GetPixel( v ) );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O, class A >
-void fpa::Image::Algorithm< I, O, A >::
-_InitMarks( )
-{
-  _TNode far_node;
-  far_node.Label = Self::FarLabel;
-  this->GetMinimumSpanningTree( )->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->GetMinimumSpanningTree( )->SetPixel( node.Vertex, node );
+  this->GetOutput( )->SetPixel( v, n.Result );
+  this->GetMinimumSpanningTree( )->SetParent( v, n.Parent, n.FrontId );
 }
 
 #endif // __FPA__IMAGE__ALGORITHM__HXX__