X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FFilters%2FImage%2FLabelsSeedFilter.hxx;fp=lib%2Ffpa%2FFilters%2FImage%2FLabelsSeedFilter.hxx;h=0000000000000000000000000000000000000000;hb=a8ac405fe1422bc0792a810f7f0693096a22c20e;hp=b23a4c31d770cad3d1237e5de5b99ed5e5fa8b04;hpb=8abe87eaa0d29ba667d5cbf35f4ca1ca2e38c6c4;p=FrontAlgorithms.git diff --git a/lib/fpa/Filters/Image/LabelsSeedFilter.hxx b/lib/fpa/Filters/Image/LabelsSeedFilter.hxx deleted file mode 100644 index b23a4c3..0000000 --- a/lib/fpa/Filters/Image/LabelsSeedFilter.hxx +++ /dev/null @@ -1,90 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Filters__Image__LabelsSeedFilter__hxx__ -#define __fpa__Filters__Image__LabelsSeedFilter__hxx__ - -#include - -// ------------------------------------------------------------------------- -template< class _TFilter, class _TInputLabels > -fpa::Filters::Image::LabelsSeedFilter< _TFilter, _TInputLabels >:: -LabelsSeedFilter( ) - : Superclass( ) -{ - fpaFilterInputConfigureMacro( InputLabels, TInputLabels ); -} - -// ------------------------------------------------------------------------- -template< class _TFilter, class _TInputLabels > -fpa::Filters::Image::LabelsSeedFilter< _TFilter, _TInputLabels >:: -~LabelsSeedFilter( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TFilter, class _TInputLabels > -const itk::DataObject* -fpa::Filters::Image::LabelsSeedFilter< _TFilter, _TInputLabels >:: -_GetReferenceInput( ) const -{ - return( this->GetInputLabels( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TFilter, class _TInputLabels > -void fpa::Filters::Image::LabelsSeedFilter< _TFilter, _TInputLabels >:: -_PrepareSeeds( const itk::DataObject* input ) -{ - // Input object is a labelled image? - const TInputLabels* labels = dynamic_cast< const TInputLabels* >( input ); - if( labels != NULL ) - { - this->m_UnifiedSeeds.clear( ); - - // Iterate over labels - typedef itk::ImageRegionConstIteratorWithIndex< TInputLabels > _TIt; - typename TInputLabels::RegionType reg = labels->GetRequestedRegion( ); - _TIt lIt( labels, reg ); - for( lIt.GoToBegin( ); !lIt.IsAtEnd( ); ++lIt ) - { - if( lIt.Get( ) > 0 ) - { - bool is_seed = false; - for( unsigned int d = 0; d < Self::Dimension; ++d ) - { - for( int s = -1; s <= 1; s += 2 ) - { - TVertex neigh = lIt.GetIndex( ); - neigh[ d ] += s; - if( reg.IsInside( neigh ) ) - is_seed |= ( labels->GetPixel( neigh ) == 0 ); - - } // rof - - } // rof - - // Add pixel as seed or already marked - TNode node; - node.Vertex = lIt.GetIndex( ); - node.Parent = lIt.GetIndex( ); - node.FrontId = lIt.Get( ); - node.Value = TOutputValue( 0 ); - if( !is_seed ) - { - this->_Mark( node.Vertex, node.FrontId ); - this->_UpdateOutputValue( node ); - } - else - this->m_UnifiedSeeds.insert( node ); - - } // fi - - } // rof - - } // fi -} - -#endif // __fpa__Filters__Image__LabelsSeedFilter__hxx__ -// eof - $RCSfile$