From 5b03bb2154f330a5eccfa87416353487dd94fc17 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@cnes.fr>
Date: Tue, 10 Nov 2015 16:56:15 +0100
Subject: [PATCH] PERF: Move the remaining of BeforeThreadedGenerateData() to
 GenerateOutputInformation() where it belongs

---
 .../include/otbNormalizeVectorImageFilter.h           |  2 +-
 .../include/otbNormalizeVectorImageFilter.txx         | 11 +++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h
index 56ec38934f..e5b3888da8 100644
--- a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h
+++ b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h
@@ -196,7 +196,7 @@ protected:
   virtual ~NormalizeVectorImageFilter() { }
 
   void GenerateOutputInformation();
-  void BeforeThreadedGenerateData();
+
 
 private:
   NormalizeVectorImageFilter ( const Self & );
diff --git a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.txx b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.txx
index c91a9df6bf..9d578bf1a9 100644
--- a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.txx
+++ b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.txx
@@ -48,15 +48,9 @@ NormalizeVectorImageFilter< TInputImage, TOutputImage >
     {
     m_CovarianceEstimator->SetInput( const_cast<InputImageType*>( this->GetInput() ) );
     m_CovarianceEstimator->Update();
-    }  
-}
+    }
 
-template < class TInputImage, class TOutputImage >
-void
-NormalizeVectorImageFilter< TInputImage, TOutputImage >
-::BeforeThreadedGenerateData ()
-{
-  if ( !m_UseMean )
+    if ( !m_UseMean )
   {
     typename TInputImage::PixelType vector ( this->GetInput()->GetNumberOfComponentsPerPixel() );
     vector.Fill( itk::NumericTraits< typename TInputImage::PixelType::ValueType >::Zero );
@@ -84,6 +78,7 @@ NormalizeVectorImageFilter< TInputImage, TOutputImage >
       this->GetFunctor().SetStdDev( sigma );
     }
   }
+
 }
 
 } // end of namespace otb
-- 
GitLab