From e9809f7a0816889b0e9051d70b59dc8690c455ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr>
Date: Mon, 2 Sep 2019 14:54:13 +0200
Subject: [PATCH] BUG: avoid recomputation of min/max at every streaming block

---
 .../app/otbDimensionalityReduction.cxx                          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
index cecb7e9045..17bf440183 100644
--- a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
+++ b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
@@ -238,7 +238,6 @@ private:
     int nbComp = GetParameterInt("nbcomp");
     bool normalize = GetParameterInt("normalize");
     bool rescale = IsParameterEnabled("rescale");
-
     bool invTransform = HasValue("outinv") && IsParameterEnabled("outinv");
     switch (GetParameterInt("method"))
       {
@@ -475,6 +474,7 @@ private:
 
       m_RescaleFilter = RescaleImageFilterType::New();
       m_RescaleFilter->SetInput(m_ForwardFilter->GetOutput());
+      m_RescaleFilter->SetAutomaticInputMinMaxComputation(false);
       m_RescaleFilter->SetInputMinimum(m_MinMaxFilter->GetMinimum());
       m_RescaleFilter->SetInputMaximum(m_MinMaxFilter->GetMaximum());
 
-- 
GitLab