1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
5 #ifndef __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__H__
6 #define __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__H__
8 #include <itkDomainThreader.h>
9 #include <itkThreadedImageRegionPartitioner.h>
11 #include <itkNumericTraits.h>
13 namespace cpExtensions
20 class ParallelImageMean
21 : public itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I >
24 // Standard ITK typedefs.
25 typedef itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I > Superclass;
26 typedef ParallelImageMean Self;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef typename Superclass::DomainType DomainType;
32 typedef itk::Array< double > TMean;
35 typedef itk::NumericTraits< typename I::PixelType > _TPixelTraits;
40 itkTypeMacro( ParallelImageMean, itkDomainThreader );
42 itkGetConstMacro( Mean, TMean );
46 virtual ~ParallelImageMean( );
49 virtual void BeforeThreadedExecution( );
50 virtual void ThreadedExecution(
51 const DomainType& region, const itk::ThreadIdType id
53 virtual void AfterThreadedExecution( );
56 itk::Array< double > m_Mean;
64 #ifndef ITK_MANUAL_INSTANTIATION
65 #include <cpExtensions/Algorithms/ParallelImageMean.hxx>
66 #endif // ITK_MANUAL_INSTANTIATION
68 #endif // __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__H__