]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/ParallelImageMean.h
...
[cpPlugins.git] / lib / cpExtensions / Algorithms / ParallelImageMean.h
index f34ca6e5f2cf7bb9cc62179c44851625f1dc2786..1fe204ae54cf0bbcab914d0c81d8e71cca9914ba 100644 (file)
 #include <itkNumericTraits.h>
 
 namespace cpExtensions
+{
+  namespace Algorithms
   {
-    namespace Algorithms
+    /**
+     */
+    template< class I >
+    class ParallelImageMean
+      : public itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I >
     {
-      /**
-       */
-      template< class I >
-      class ParallelImageMean
-        : public itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I >
-      {
-      public:
-        // Standard ITK typedefs.
-        typedef itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I > Superclass;
-        typedef ParallelImageMean               Self;
-        typedef itk::SmartPointer< Self >       Pointer;
-        typedef itk::SmartPointer< const Self > ConstPointer;
-
-        typedef typename Superclass::DomainType DomainType;
-
-        typedef itk::Array< double > TMean;
-
-      protected:
-        typedef itk::NumericTraits< typename I::PixelType > _TPixelTraits;
-
-
-      public:
-        itkNewMacro( Self );
-        itkTypeMacro( ParallelImageMean, itkDomainThreader );
-
-        itkGetConstMacro( Mean, TMean );
-
-      protected:
-        ParallelImageMean( );
-        virtual ~ParallelImageMean( );
-
-      private:
-        virtual void BeforeThreadedExecution( );
-        virtual void ThreadedExecution(
-          const DomainType& region, const itk::ThreadIdType id
-          );
-        virtual void AfterThreadedExecution( );
-
-      protected:
-        itk::Array< double > m_Mean;
-        unsigned long m_N;
-      };
-
-    } // ecapseman
+    public:
+      // Standard ITK typedefs.
+      typedef itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I > Superclass;
+      typedef ParallelImageMean               Self;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef typename Superclass::DomainType DomainType;
+
+      typedef itk::Array< double > TMean;
+
+    protected:
+      typedef itk::NumericTraits< typename I::PixelType > _TPixelTraits;
+
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( ParallelImageMean, itkDomainThreader );
+
+      itkGetConstMacro( Mean, TMean );
+
+    protected:
+      ParallelImageMean( );
+      virtual ~ParallelImageMean( );
+
+    private:
+      virtual void BeforeThreadedExecution( );
+      virtual void ThreadedExecution(
+        const DomainType& region, const itk::ThreadIdType id
+        );
+      virtual void AfterThreadedExecution( );
+
+    protected:
+      itk::Array< double > m_Mean;
+      unsigned long m_N;
+    };
+
+  } // ecapseman
 
 } // ecapseman