From b49835d5e9a4f9967a86ca5b031c486d83d0c621 Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@cnes.fr> Date: Tue, 28 Feb 2017 11:54:44 +0100 Subject: [PATCH] BUG: Fix #1366 (call UpdateOutputInformation() on all image outputs from Application->Execute() ) --- .../src/otbWrapperApplication.cxx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 6a8a8795a4..b563ac4c95 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -378,6 +378,35 @@ int Application::Execute() this->DoExecute(); + // Update output information on every output image parameter + for (std::vector<std::string>::const_iterator it = paramList.begin(); + it != paramList.end(); + ++it) + { + std::string key = *it; + if (GetParameterType(key) == ParameterType_OutputImage + && IsParameterEnabled(key) ) + { + Parameter* param = GetParameterByKey(key); + OutputImageParameter* outputParam = dynamic_cast<OutputImageParameter*>(param); + + if(outputParam!=ITK_NULLPTR) + { + outputParam->GetImage()->UpdateOutputInformation(); + } + } + else if (GetParameterType(key) == ParameterType_ComplexOutputImage + && IsParameterEnabled(key)) + { + Parameter* param = GetParameterByKey(key); + ComplexOutputImageParameter* outputParam = dynamic_cast<ComplexOutputImageParameter*>(param); + + if(outputParam!=ITK_NULLPTR) + { + outputParam->GetImage()->UpdateOutputInformation(); + } + } + } return 0; } -- GitLab