Skip to content

Commit

Permalink
Merge pull request #57 from PreibischLab/bugfix
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
StephanPreibisch authored Sep 25, 2024
2 parents 30f2982 + 6404f57 commit 484b78d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ else if ( storageType == StorageFormat.HDF5 )
for ( int level = 1; level < mrInfo.length; ++level )
{
final int s = level;
final ArrayList<long[][]> allBlocks = N5ApiTools.assembleJobs( mrInfo[ level ] );
final List<long[][]> 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() );
Expand Down
33 changes: 18 additions & 15 deletions src/main/java/net/preibisch/mvrecon/process/n5api/N5ApiTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,70 +423,70 @@ public static < T extends NativeType< T > & RealType< T > > void writeDownsample
N5Utils.saveNonEmptyBlock(sourceGridBlock, n5, dataset, gridBlock[2], type);
}

public static ArrayList<long[][]> assembleJobs( final MultiResolutionLevelInfo mrInfo )
public static List<long[][]> assembleJobs( final MultiResolutionLevelInfo mrInfo )
{
return assembleJobs( null, mrInfo );
}

public static ArrayList<long[][]> assembleJobs( final MultiResolutionLevelInfo mrInfo, final int[] computeBlockSize )
public static List<long[][]> assembleJobs( final MultiResolutionLevelInfo mrInfo, final int[] computeBlockSize )
{
return assembleJobs( null, mrInfo, computeBlockSize );
}

public static ArrayList<long[][]> assembleJobs(
public static List<long[][]> assembleJobs(
final ViewId viewId,
final MultiResolutionLevelInfo mrInfo )
{
return assembleJobs( viewId, mrInfo.dimensions, mrInfo.blockSize, mrInfo.blockSize );
}

public static ArrayList<long[][]> assembleJobs(
public static List<long[][]> assembleJobs(
final ViewId viewId,
final MultiResolutionLevelInfo mrInfo,
final int[] computeBlockSize )
{
return assembleJobs( viewId, mrInfo.dimensions, mrInfo.blockSize, computeBlockSize );
}

public static ArrayList<long[][]> assembleJobs(
public static List<long[][]> assembleJobs(
final long[] dimensions,
final int[] blockSize )
{
return assembleJobs(null, dimensions, blockSize, blockSize );
}

public static ArrayList<long[][]> assembleJobs(
public static List<long[][]> assembleJobs(
final long[] dimensions,
final int[] blockSize,
final int[] computeBlockSize )
{
return assembleJobs(null, dimensions, blockSize, computeBlockSize );
}

public static ArrayList<long[][]> assembleJobs(
final ViewId viewId, //can be null
public static List<long[][]> assembleJobs(
final ViewId viewId, //can be null
final long[] dimensions,
final int[] blockSize )
{
return assembleJobs(viewId, dimensions, blockSize, blockSize );
}

public static ArrayList<long[][]> assembleJobs(
final ViewId viewId, //can be null
public static List<long[][]> assembleJobs(
final ViewId viewId, //can be null
final long[] dimensions,
final int[] blockSize,
final int[] computeBlockSize )
{
// all blocks (a.k.a. grids)
final ArrayList<long[][]> allBlocks = new ArrayList<>();

final List<long[][]> grid = Grid.create(
dimensions,
computeBlockSize,
blockSize);

if ( viewId != null )
{
// all blocks (a.k.a. grids)
final List<long[][]> allBlocks = new ArrayList<>();

// add timepointId and ViewSetupId & dimensions to the gridblock
for ( final long[][] gridBlock : grid )
allBlocks.add( new long[][]{
Expand All @@ -495,9 +495,12 @@ public static ArrayList<long[][]> assembleJobs(
gridBlock[ 2 ].clone(),
new long[] { viewId.getTimePointId(), viewId.getViewSetupId() }
});
return allBlocks;
}
else
{
return grid;
}

return allBlocks;
}

public static int[] computeRelativeDownsampling(
Expand Down

0 comments on commit 484b78d

Please sign in to comment.