From 4ee68d0f30ebb6a4c4d94b3f4ad4a3bf2c9daec4 Mon Sep 17 00:00:00 2001 From: Michael Innerberger Date: Thu, 10 Oct 2024 10:59:09 -0400 Subject: [PATCH] Limit chunk size in z --- .../render/client/spark/destreak/StreakStatisticsClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render-ws-spark-client/src/main/java/org/janelia/render/client/spark/destreak/StreakStatisticsClient.java b/render-ws-spark-client/src/main/java/org/janelia/render/client/spark/destreak/StreakStatisticsClient.java index ffa83a2f4..80795b927 100644 --- a/render-ws-spark-client/src/main/java/org/janelia/render/client/spark/destreak/StreakStatisticsClient.java +++ b/render-ws-spark-client/src/main/java/org/janelia/render/client/spark/destreak/StreakStatisticsClient.java @@ -201,7 +201,7 @@ private void storeData(final Img data, final Bounds stackBounds) { // transpose data because images are F-order and python expects C-order final RandomAccessibleInterval transposedData = Views.permute(data, 0, 2); final String dataset = Paths.get(parameters.renderWeb.project, parameters.stack).toString(); - final int[] fullDimensions = Arrays.stream(transposedData.dimensionsAsLongArray()).mapToInt(i -> (int) i).toArray(); + final int[] chunkSize = new int[] {parameters.nCellsX(), parameters.nCellsY(), Math.min(1000, (int) transposedData.dimension(2))}; final double[] min = new double[3]; min[0] = stackBounds.getMinX(); @@ -214,7 +214,7 @@ private void storeData(final Img data, final Bounds stackBounds) { max[2] = stackBounds.getMaxZ(); try (final N5Writer n5Writer = new N5ZarrWriter(parameters.outputPath)) { - N5Utils.save(transposedData, n5Writer, dataset, fullDimensions, new GzipCompression()); + N5Utils.save(transposedData, n5Writer, dataset, chunkSize, new GzipCompression()); n5Writer.setAttribute(dataset, "StackBounds", Map.of("min", min, "max", max)); final Map runParameters = Map.of(