Bug mixing slicers/math and other apps

System

  • OTBTF 3.1 docker image
  • pyotb 1.3.3

How to reproduce

import pyotb
xs = pyotb.OpticalCalibration('some_4bands_raster.tif')
nir = xs[:, :, 3]
r = xs[:, :, 0]
ndvi = (nir - r)/(nir + r)
xs.write("xs.tif", pixel_type='uint8')
ndvi.write("ndvi.tif", pixel_type='uint8')

Gives:

RuntimeError: Exception thrown in otbApplication Application_ExecuteAndWriteOutput: /build/insighttoolkit4-CEtaGF/insighttoolkit4-4.13.2-dfsg1/Modules/Core/Common/src/itkMultiThreader.cxx:399:
itk::ERROR: MultiThreader(0x2bbeee0): Exception occurred during SingleMethodExecute
/usr/include/ITK-4.13/itkImageConstIterator.h:210:
itk::ERROR: Region ImageRegion (0x7ffdb79df610)
  Dimension: 2
  Index: [0, 0]
  Size: [1408, 183]
 is outside of buffered region ImageRegion (0x2b61f50)
  Dimension: 2
  Index: [0, 0]
  Size: [0, 0]

Notes:

  • when we comment one of the writing operations, it works.
  • when we write xs before declaring the ndvi, it works.

We should also

  • Add this test in the CI
Edited by Nicolas Narçon