From 6404f57ced3ef4895f99fe49a4d5c0871705638a Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Wed, 25 Sep 2024 17:39:46 +0200 Subject: [PATCH] bugfix --- .../mvrecon/process/export/ExportN5Api.java | 2 +- .../mvrecon/process/n5api/N5ApiTools.java | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java b/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java index 370d4733..0290fafa 100644 --- a/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java +++ b/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java @@ -332,7 +332,7 @@ else if ( storageType == StorageFormat.HDF5 ) for ( int level = 1; level < mrInfo.length; ++level ) { final int s = level; - final ArrayList allBlocks = N5ApiTools.assembleJobs( mrInfo[ level ] ); + final List allBlocks = N5ApiTools.assembleJobs( mrInfo[ level ] ); IOFunctions.println( new Date( System.currentTimeMillis() ) + ": Downsampling: " + Util.printCoordinates( mrInfo[ level ].absoluteDownsampling ) + " with relative downsampling of " + Util.printCoordinates( mrInfo[ level ].relativeDownsampling )); IOFunctions.println( new Date( System.currentTimeMillis() ) + ": s" + level + " num blocks=" + allBlocks.size() ); diff --git a/src/main/java/net/preibisch/mvrecon/process/n5api/N5ApiTools.java b/src/main/java/net/preibisch/mvrecon/process/n5api/N5ApiTools.java index 1d8001d1..d9d2932c 100644 --- a/src/main/java/net/preibisch/mvrecon/process/n5api/N5ApiTools.java +++ b/src/main/java/net/preibisch/mvrecon/process/n5api/N5ApiTools.java @@ -423,24 +423,24 @@ public static < T extends NativeType< T > & RealType< T > > void writeDownsample N5Utils.saveNonEmptyBlock(sourceGridBlock, n5, dataset, gridBlock[2], type); } - public static ArrayList assembleJobs( final MultiResolutionLevelInfo mrInfo ) + public static List assembleJobs( final MultiResolutionLevelInfo mrInfo ) { return assembleJobs( null, mrInfo ); } - public static ArrayList assembleJobs( final MultiResolutionLevelInfo mrInfo, final int[] computeBlockSize ) + public static List assembleJobs( final MultiResolutionLevelInfo mrInfo, final int[] computeBlockSize ) { return assembleJobs( null, mrInfo, computeBlockSize ); } - public static ArrayList assembleJobs( + public static List assembleJobs( final ViewId viewId, final MultiResolutionLevelInfo mrInfo ) { return assembleJobs( viewId, mrInfo.dimensions, mrInfo.blockSize, mrInfo.blockSize ); } - public static ArrayList assembleJobs( + public static List assembleJobs( final ViewId viewId, final MultiResolutionLevelInfo mrInfo, final int[] computeBlockSize ) @@ -448,14 +448,14 @@ public static ArrayList assembleJobs( return assembleJobs( viewId, mrInfo.dimensions, mrInfo.blockSize, computeBlockSize ); } - public static ArrayList assembleJobs( + public static List assembleJobs( final long[] dimensions, final int[] blockSize ) { return assembleJobs(null, dimensions, blockSize, blockSize ); } - public static ArrayList assembleJobs( + public static List assembleJobs( final long[] dimensions, final int[] blockSize, final int[] computeBlockSize ) @@ -463,23 +463,20 @@ public static ArrayList assembleJobs( return assembleJobs(null, dimensions, blockSize, computeBlockSize ); } - public static ArrayList assembleJobs( - final ViewId viewId, //can be null + public static List assembleJobs( + final ViewId viewId, //can be null final long[] dimensions, final int[] blockSize ) { return assembleJobs(viewId, dimensions, blockSize, blockSize ); } - public static ArrayList assembleJobs( - final ViewId viewId, //can be null + public static List assembleJobs( + final ViewId viewId, //can be null final long[] dimensions, final int[] blockSize, final int[] computeBlockSize ) { - // all blocks (a.k.a. grids) - final ArrayList allBlocks = new ArrayList<>(); - final List grid = Grid.create( dimensions, computeBlockSize, @@ -487,6 +484,9 @@ public static ArrayList assembleJobs( if ( viewId != null ) { + // all blocks (a.k.a. grids) + final List allBlocks = new ArrayList<>(); + // add timepointId and ViewSetupId & dimensions to the gridblock for ( final long[][] gridBlock : grid ) allBlocks.add( new long[][]{ @@ -495,9 +495,12 @@ public static ArrayList assembleJobs( gridBlock[ 2 ].clone(), new long[] { viewId.getTimePointId(), viewId.getViewSetupId() } }); + return allBlocks; + } + else + { + return grid; } - - return allBlocks; } public static int[] computeRelativeDownsampling(