From 2c4508ef9ec937f0c6d7d4275e6b040539411efc Mon Sep 17 00:00:00 2001
From: Remi Cresson <remi.cresson@irstea.fr>
Date: Sat, 10 Nov 2018 14:34:09 +0100
Subject: [PATCH] FIX: req region outside largest region issue

---
 include/otbTensorflowMultisourceModelFilter.hxx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/otbTensorflowMultisourceModelFilter.hxx b/include/otbTensorflowMultisourceModelFilter.hxx
index c09850b..4d9d937 100644
--- a/include/otbTensorflowMultisourceModelFilter.hxx
+++ b/include/otbTensorflowMultisourceModelFilter.hxx
@@ -339,7 +339,13 @@ TensorflowMultisourceModelFilter<TInputImage, TOutputImage>
       {
       int valToPad = 1 + (this->GetOutputExpressionFields().at(0)[dim] - 1) * m_OutputSpacingScale * this->GetInput(0)->GetSpacing()[dim] / this->GetInput(i)->GetSpacing()[dim] ;
       if (valToPad > toPad[dim])
-        itkExceptionMacro("The input requested region of image #" << i << " is not consistent. Please check RF, EF, SF vs physical spacing.");
+        itkExceptionMacro("The input requested region of source #" << i << " is not consistent (dim "<< dim<< ")." <<
+                          "Please check RF, EF, SF vs physical spacing of your image!" <<
+                          "\nReceptive field: " << this->GetInputReceptiveFields().at(i)[dim] <<
+                          "\nExpression field: " << this->GetOutputExpressionFields().at(0)[dim] <<
+                          "\nScale factor: " << m_OutputSpacingScale <<
+                          "\nReference image spacing: " << this->GetInput(0)->GetSpacing()[dim] <<
+                          "\nImage " << i << " spacing: " << this->GetInput(i)->GetSpacing()[dim]);
       toPad[dim] -= valToPad;
       }
 
-- 
GitLab