From bc17ca23a5855994a88d107906868f78c9b8dd28 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Tue, 17 Oct 2023 12:57:11 +0200 Subject: [PATCH] correct tensor transformation --- src/main/java/io/bioimage/modelrunner/tensor/Utils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/bioimage/modelrunner/tensor/Utils.java b/src/main/java/io/bioimage/modelrunner/tensor/Utils.java index 76025c1d..84caae60 100644 --- a/src/main/java/io/bioimage/modelrunner/tensor/Utils.java +++ b/src/main/java/io/bioimage/modelrunner/tensor/Utils.java @@ -51,9 +51,9 @@ RandomAccessibleInterval transpose(RandomAccessibleInterval rai){ int[] transposeAxesOrderChange = new int[tensorShape.length]; for (int i = 0; i < tensorShape.length; i ++) transposeAxesOrderChange[i] = tensorShape.length - 1 - i; t.setComponentMapping(transposeAxesOrderChange); - long[] minMax = new long[tensorShape.length]; - for (int i = 0; i < tensorShape.length; i ++) minMax[i * 2 + 1] = tensorShape[i]; + long[] minMax = new long[tensorShape.length * 2]; + for (int i = 0; i < tensorShape.length; i ++) minMax[i + tensorShape.length] = tensorShape[i] - 1; return Views.interval(new MixedTransformView( rai, t ), - Intervals.createMinMax(tensorShape)); + Intervals.createMinMax(minMax)); } }