X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FImageFunctionFilter.hxx;fp=lib%2FcpExtensions%2FAlgorithms%2FImageFunctionFilter.hxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=c96c0928ab36c3ef7a25e0839d0f359407c16a9a;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/ImageFunctionFilter.hxx b/lib/cpExtensions/Algorithms/ImageFunctionFilter.hxx deleted file mode 100644 index c96c092..0000000 --- a/lib/cpExtensions/Algorithms/ImageFunctionFilter.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// ------------------------------------------------------------------------- -// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) -// ------------------------------------------------------------------------- - -#ifndef __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__HXX__ -#define __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__HXX__ - -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -template< class _TInput, class _TOutput, class _TFilter > -cpExtensions::Algorithms::ImageFunctionFilter< _TInput, _TOutput, _TFilter >:: -ImageFunctionFilter( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TInput, class _TOutput, class _TFilter > -cpExtensions::Algorithms::ImageFunctionFilter< _TInput, _TOutput, _TFilter >:: -~ImageFunctionFilter( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TInput, class _TOutput, class _TFilter > -void cpExtensions::Algorithms::ImageFunctionFilter< _TInput, _TOutput, _TFilter >:: -BeforeThreadedGenerateData( ) -{ - if( this->m_Function.IsNull( ) ) - itkExceptionMacro( << "Please set a valid itk::ImageFunction" ); - this->m_Function->SetInputImage( this->GetInput( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TInput, class _TOutput, class _TFilter > -void cpExtensions::Algorithms::ImageFunctionFilter< _TInput, _TOutput, _TFilter >:: -ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId ) -{ - const typename TRegion::SizeType& regionSize = region.GetSize( ); - if( regionSize[ 0 ] == 0 ) - return; - const _TInput* in = this->GetInput( ); - _TOutput* out = this->GetOutput( 0 ); - - itk::ProgressReporter pr( this, threadId, region.GetNumberOfPixels( ) ); - - // Define the iterators - itk::ImageRegionConstIteratorWithIndex< TInput > iIt( in, region ); - itk::ImageRegionIteratorWithIndex< TOutput > oIt( out, region ); - - iIt.GoToBegin( ); - oIt.GoToBegin( ); - for( ; !iIt.IsAtEnd( ) && !oIt.IsAtEnd( ); ++iIt, ++oIt ) - { - oIt.Set( this->m_Function->EvaluateAtIndex( iIt.GetIndex( ) ) ); - pr.CompletedPixel( ); - - } // rof -} - -#endif // __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__HXX__ - -// eof - $RCSfile$