From a0425532059ceef91afcea83049a14ab2f43c0e6 Mon Sep 17 00:00:00 2001
From: "raffaele.gaetano" <raffaele.gaetano@cirad.fr>
Date: Thu, 18 Mar 2021 10:28:04 +0100
Subject: [PATCH] FIX: pixel type for tiled inputs.

---
 segmentationWorkflow.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/segmentationWorkflow.py b/segmentationWorkflow.py
index 011b08d..c62062c 100644
--- a/segmentationWorkflow.py
+++ b/segmentationWorkflow.py
@@ -171,6 +171,7 @@ def segmentation_big_tiles(seg_in, seg_out, tmp_fld, params, tile_layout=[2,2],
         rois[-1].SetParameterInt('sizey', roi[3])
         seg_in_tmp.append(os.path.join(tmp_fld, os.path.basename(seg_in).replace('.tif', '_%d.tif' % i)))
         rois[-1].SetParameterString('out', seg_in_tmp[-1])
+        rois[-1].SetParameterOutputImagePixelType('out', otb.ImagePixelType_uint16)
         rois[-1].ExecuteAndWriteOutput()
         seg_out_tmp.append(os.path.join(tmp_fld, os.path.basename(seg_out).replace('.tif', '_%d.tif' % i)))
         cmd = ['otbcli_LSGRM', '-in', seg_in_tmp[-1], '-threshold', params[0], '-criterion.bs.cw', params[1],
-- 
GitLab