X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FParallelImageMean.hxx;fp=lib%2FcpExtensions%2FAlgorithms%2FParallelImageMean.hxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=b3e4716075bdcaad0326ae229a0f4d2448299ba8;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/ParallelImageMean.hxx b/lib/cpExtensions/Algorithms/ParallelImageMean.hxx deleted file mode 100644 index b3e4716..0000000 --- a/lib/cpExtensions/Algorithms/ParallelImageMean.hxx +++ /dev/null @@ -1,65 +0,0 @@ -// ------------------------------------------------------------------------- -// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) -// ------------------------------------------------------------------------- - -#ifndef __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__HXX__ -#define __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__HXX__ - -#include - -// ------------------------------------------------------------------------- -template< class I > -cpExtensions::Algorithms::ParallelImageMean< I >:: -ParallelImageMean( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< class I > -cpExtensions::Algorithms::ParallelImageMean< I >:: -~ParallelImageMean( ) -{ -} - -// ------------------------------------------------------------------------- -template< class I > -void cpExtensions::Algorithms::ParallelImageMean< I >:: -BeforeThreadedExecution( ) -{ - this->m_Mean.SetSize( _TPixelTraits::GetLength( ) ); - this->m_Mean.Fill( double( 0 ) ); - this->m_N = 0; -} - -// ------------------------------------------------------------------------- -template< class I > -void cpExtensions::Algorithms::ParallelImageMean< I >:: -ThreadedExecution( const DomainType& region, const itk::ThreadIdType id ) -{ - itk::ImageRegionConstIterator< I > i( this->m_Associate, region ); - for( i.GoToBegin( ); !i.IsAtEnd( ); ++i ) - { - for( unsigned int d = 0; d < _TPixelTraits::GetLength( ); ++d ) - { - this->m_Mean.SetElement( - d, this->m_Mean.GetElement( d ) + double( i.Get( )[ d ] ) - ); - this->m_N++; - - } // rof - - } // rof -} - -// ------------------------------------------------------------------------- -template< class I > -void cpExtensions::Algorithms::ParallelImageMean< I >:: -AfterThreadedExecution( ) -{ - this->m_Mean /= double( this->m_N ); -} - -#endif // __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__HXX__ - -// eof - $RCSfile$