]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/RandomWalker.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / RandomWalker.hxx
diff --git a/lib/fpa/Image/RandomWalker.hxx b/lib/fpa/Image/RandomWalker.hxx
deleted file mode 100644 (file)
index 6935abf..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-// =========================================================================
-// @author Leonardo Florez Valencia
-// @email florez-l@javeriana.edu.co
-// =========================================================================
-
-#ifndef __fpa__Image__RandomWalker__hxx__
-#define __fpa__Image__RandomWalker__hxx__
-
-#include <sstream>
-
-#include <itkImageRegionConstIteratorWithIndex.h>
-#include <itkExceptionObject.h>
-
-#include <fpa/Image/Functors/Dijkstra/Gaussian.h>
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage, class _TScalar >
-itk::ModifiedTimeType
-fpa::Image::RandomWalker< _TInputImage, _TLabelImage, _TScalar >::
-GetMTime( ) const
-{
-  const TLabelImage* labels = this->GetLabels( );
-  itk::ModifiedTimeType t = this->Superclass::GetMTime( );
-  if( labels != NULL )
-  {
-    itk::ModifiedTimeType q = labels->GetMTime( );
-    t = ( q < t )? q: t;
-
-  } // fi
-  return( t );
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage, class _TScalar >
-fpa::Image::RandomWalker< _TInputImage, _TLabelImage, _TScalar >::
-RandomWalker( )
-  : Superclass( )
-{
-  typedef fpa::Image::Functors::Dijkstra::Gaussian< TInputImage, TScalar > _TDefaultFunction;
-  this->SetWeightFunction( _TDefaultFunction::New( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage, class _TScalar >
-fpa::Image::RandomWalker< _TInputImage, _TLabelImage, _TScalar >::
-~RandomWalker( )
-{
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage, class _TScalar >
-void fpa::Image::RandomWalker< _TInputImage, _TLabelImage, _TScalar >::
-_BeforeGenerateData( )
-{
-  this->Superclass::_BeforeGenerateData( );
-  TWeightFunction* wf =
-    dynamic_cast< TWeightFunction* >( this->GetWeightFunction( ) );
-  if( wf != NULL )
-    wf->SetImage( this->GetInput( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage, class _TScalar >
-typename fpa::Image::RandomWalker< _TInputImage, _TLabelImage, _TScalar >::
-TNodes fpa::Image::RandomWalker< _TInputImage, _TLabelImage, _TScalar >::
-_UnifySeeds( )
-{
-  this->m_Seeds.clear( );
-  const TLabelImage* lbl = this->GetLabels( );
-  if( lbl == NULL )
-  {
-    std::ostringstream msg;
-    msg << "itk::ERROR: fpa::Image::RandomWalker (" << this
-        << "): Labelled image not defined.";
-    ::itk::ExceptionObject e(
-      __FILE__, __LINE__, msg.str( ).c_str( ), ITK_LOCATION
-      );
-    throw e;
-
-  } // fi
-
-  // Iterate over labels
-  typename TLabelImage::RegionType reg = lbl->GetRequestedRegion( );
-  itk::ImageRegionConstIteratorWithIndex< TLabelImage > lIt( lbl, reg );
-  for( lIt.GoToBegin( ); !lIt.IsAtEnd( ); ++lIt )
-  {
-    if( lIt.Get( ) > 0 )
-    {
-      bool is_seed = false;
-      for( unsigned int d = 0; d < TLabelImage::ImageDimension; ++d )
-      {
-        for( int s = -1; s <= 1; s += 2 )
-        {
-          TVertex neigh = lIt.GetIndex( );
-          neigh[ d ] += s;
-          if( reg.IsInside( neigh ) )
-            is_seed |= ( lbl->GetPixel( neigh ) == 0 );
-
-        } // rof
-
-      } // rof
-
-      if( !is_seed )
-      {
-        TNode node;
-        node.Vertex = lIt.GetIndex( );
-        node.Parent = lIt.GetIndex( );
-        node.FrontId = lIt.Get( );
-        node.Value = TScalar( 0 );
-        this->_Mark( node.Vertex, node.FrontId );
-        this->_UpdateOutputValue( node );
-      }
-      else
-      {
-        TSeed seed;
-        seed.Vertex = lIt.GetIndex( );
-        seed.IsPoint = false;
-        seed.FrontId = lIt.Get( );
-        this->m_Seeds.push_back( seed );
-
-      } // fi
-
-    } // fi
-
-  } // rof
-
-  // Ok, finish initialization
-  return( this->Superclass::_UnifySeeds( ) );
-}
-
-#endif // __fpa__Image__RandomWalker__hxx__
-
-// eof - $RCSfile$