From b61c7c12b54fdaa0999d6697b437bc9108e3e102 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Thu, 26 Oct 2023 17:18:48 +0200 Subject: [PATCH] add more comments --- .../bioimage/modelrunner/tiling/PatchSpec.java | 4 +++- .../modelrunner/utils/IndexingUtils.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/io/bioimage/modelrunner/tiling/PatchSpec.java b/src/main/java/io/bioimage/modelrunner/tiling/PatchSpec.java index 5567350d..fcee0b07 100644 --- a/src/main/java/io/bioimage/modelrunner/tiling/PatchSpec.java +++ b/src/main/java/io/bioimage/modelrunner/tiling/PatchSpec.java @@ -65,7 +65,9 @@ public class PatchSpec * sequence sizes. * @param patchPaddingSize * The padding size used on each patch. - * @return The create patch specification. + * @param tensorDims + * The original size of the image/tensor that is going to be tiled + * @return The create patch specification. */ public static PatchSpec create(String tensorName, long[] patchInputSize, int[] patchGridSize, int[][] patchPaddingSize, long[] tensorDims) diff --git a/src/main/java/io/bioimage/modelrunner/utils/IndexingUtils.java b/src/main/java/io/bioimage/modelrunner/utils/IndexingUtils.java index fdab2560..e20a17fa 100644 --- a/src/main/java/io/bioimage/modelrunner/utils/IndexingUtils.java +++ b/src/main/java/io/bioimage/modelrunner/utils/IndexingUtils.java @@ -33,7 +33,7 @@ public class IndexingUtils { /** - * Obtain a flat index position from a multidimensional index position + * Obtain a flat index position from a multidimensional index position, assumes row major (C-order) * * @param ind * the multidimensional indexes @@ -75,7 +75,7 @@ public static void main(String[] args) { } /** - * Obtain a flat index position from a multidimensional index position + * Obtain a flat index position from a multidimensional index position, assumes row major (C-order) * * @param ind * the multidimensional indexes @@ -97,10 +97,10 @@ public static int multidimensionalIntoFlatIndex( long[] ind, long[] size ) } /** - * Obtain a flat index position from a multidimensional index position + * Obtain the multidimensional position corresponding to a flat position in an nd array * - * @param ind - * the index of the position as if it was a flat array + * @param flat + * flat position in an nd-array, assumes row major (C-order) * @param size * size of the tensor * @return the multidimensional indexes @@ -121,10 +121,10 @@ public static long[] flatIntoMultidimensionalIndex( long flat, long[] size ) } /** - * Obtain a flat index position from a multidimensional index position + * Obtain the multidimensional position corresponding to a flat position in an nd array * - * @param ind - * the index of the position as if it was a flat array + * @param flat + * flat position in an nd-array, assumes row major (C-order) * @param size * size of the tensor * @return the multidimensional indexes