From 355b6c8f54f6449d75d1c6595309e981c2226357 Mon Sep 17 00:00:00 2001 From: dlegland Date: Wed, 7 Feb 2024 16:54:08 +0100 Subject: [PATCH] morphology/strel/EllipsoidStrel: fix computation of offset --- .../inra/ijpb/morphology/strel/EllipsoidStrel.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/inra/ijpb/morphology/strel/EllipsoidStrel.java b/src/main/java/inra/ijpb/morphology/strel/EllipsoidStrel.java index 870522d8..b17fa91d 100644 --- a/src/main/java/inra/ijpb/morphology/strel/EllipsoidStrel.java +++ b/src/main/java/inra/ijpb/morphology/strel/EllipsoidStrel.java @@ -178,12 +178,14 @@ public int[][][] getMask3D() return mask; } - @Override - public int[] getOffset() - { - int intRadius = (int) Math.round(xRadius); - return new int[]{intRadius, intRadius, intRadius}; - } + @Override + public int[] getOffset() + { + int intRadiusX = (int) Math.round(xRadius); + int intRadiusY = (int) Math.round(yRadius); + int intRadiusZ = (int) Math.round(zRadius); + return new int[] { intRadiusX, intRadiusY, intRadiusZ }; + } @Override public int[][] getShifts3D()