From cb050f07c1a583c583ccdf59365f36cc6148fc94 Mon Sep 17 00:00:00 2001 From: Stephan Preibisch Date: Sat, 7 Sep 2024 16:25:05 -0400 Subject: [PATCH] renamed variable --- .../mvrecon/process/export/ExportN5API.java | 77 +------------------ 1 file changed, 4 insertions(+), 73 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 86d786e0..4052e357 100644 --- a/src/main/java/net/preibisch/mvrecon/process/export/ExportN5API.java +++ b/src/main/java/net/preibisch/mvrecon/process/export/ExportN5API.java @@ -437,86 +437,17 @@ else if ( FloatType.class.isInstance( type ) ) time = System.currentTimeMillis(); - final Function viewIdToDataset = (gridBlock -> datasetDownsampling); // there is only one ViewId, so no matter which gridBlock, its always the same - final Function viewIdToDatasetPreviousScale = (gridBlock -> datasetPrev); // there is only one ViewId + final Function gridBlockToDataset = (gridBlock -> datasetDownsampling); // there is only one ViewId, so no matter which gridBlock, its always the same + final Function gridBlockToDatasetPreviousScale = (gridBlock -> datasetPrev); // there is only one ViewId e.submit( () -> gridDS.parallelStream().forEach( gridBlock -> N5ResaveTools.writeDownsampledBlock( driverVolumeWriter, - viewIdToDataset, - viewIdToDatasetPreviousScale, + gridBlockToDataset, + gridBlockToDatasetPreviousScale, ds, gridBlock ) ) ); - /* - e.submit(() -> - gridDS.parallelStream().forEach( - gridBlock -> - { - try - { - if ( dataType == DataType.UINT16 ) - { - RandomAccessibleInterval downsampled = N5Utils.open(driverVolumeWriter, datasetPrev); - - for ( int d = 0; d < downsampled.numDimensions(); ++d ) - if ( ds[ d ] > 1 ) - downsampled = LazyHalfPixelDownsample2x.init( - downsampled, - new FinalInterval( downsampled ), - new UnsignedShortType(), - blocksize(), - d); - - final RandomAccessibleInterval sourceGridBlock = Views.offsetInterval(downsampled, gridBlock[0], gridBlock[1]); - N5Utils.saveNonEmptyBlock(sourceGridBlock, driverVolumeWriter, datasetDownsampling, gridBlock[2], new UnsignedShortType()); - } - else if ( dataType == DataType.UINT8 ) - { - RandomAccessibleInterval downsampled = N5Utils.open(driverVolumeWriter, datasetPrev); - - for ( int d = 0; d < downsampled.numDimensions(); ++d ) - if ( ds[ d ] > 1 ) - downsampled = LazyHalfPixelDownsample2x.init( - downsampled, - new FinalInterval( downsampled ), - new UnsignedByteType(), - blocksize(), - d); - - final RandomAccessibleInterval sourceGridBlock = Views.offsetInterval(downsampled, gridBlock[0], gridBlock[1]); - N5Utils.saveNonEmptyBlock(sourceGridBlock, driverVolumeWriter, datasetDownsampling, gridBlock[2], new UnsignedByteType()); - } - else if ( dataType == DataType.FLOAT32 ) - { - RandomAccessibleInterval downsampled = N5Utils.open(driverVolumeWriter, datasetPrev); - - for ( int d = 0; d < downsampled.numDimensions(); ++d ) - if ( ds[ d ] > 1 ) - downsampled = LazyHalfPixelDownsample2x.init( - downsampled, - new FinalInterval( downsampled ), - new FloatType(), - blocksize(), - d); - - final RandomAccessibleInterval sourceGridBlock = Views.offsetInterval(downsampled, gridBlock[0], gridBlock[1]); - N5Utils.saveNonEmptyBlock(sourceGridBlock, driverVolumeWriter, datasetDownsampling, gridBlock[2], new FloatType()); - } - else - { - IOFunctions.println( "Unsupported pixel type: " + dataType ); - throw new RuntimeException("Unsupported pixel type: " + dataType ); - } - } - catch (Exception exc) - { - IOFunctions.println( "Error writing block offset=" + Util.printCoordinates( gridBlock[0] ) + "' ... " + exc ); - exc.printStackTrace(); - } - } ) - );*/ - try { e.shutdown();