Skip to content

Commit 9cae8f3

Browse files
authored
Merge pull request #24 from saalfeldlab/migrate-n5-4.0
Migrate n5 4.0
2 parents 436f3a3 + 32d63fa commit 9cae8f3

18 files changed

Lines changed: 134 additions & 144 deletions

pom.xml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<parent>
55
<groupId>org.scijava</groupId>
66
<artifactId>pom-scijava</artifactId>
7-
<version>37.0.0</version>
7+
<version>45.0.0</version>
88
</parent>
99

1010
<groupId>org.janelia.saalfeldlab</groupId>
1111
<artifactId>label-utilities-spark</artifactId>
12-
<version>1.1.1-SNAPSHOT</version>
12+
<version>1.2.0-SNAPSHOT</version>
1313

1414
<name>N5-Label-Multisets-Spark</name>
1515
<description>Spark based tools for label data.</description>
@@ -99,15 +99,6 @@
9999
<javadoc.skip>true</javadoc.skip>
100100
<maven.javadoc.skip>${javadoc.skip}</maven.javadoc.skip>
101101

102-
<n5.version>3.3.1</n5.version>
103-
<n5-aws-s3.version>4.2.2</n5-aws-s3.version>
104-
<n5-google-cloud.version>4.1.2</n5-google-cloud.version>
105-
<n5-universe.version>2.0.1</n5-universe.version>
106-
<n5-hdf5.version>2.2.0</n5-hdf5.version>
107-
<n5-zarr.version>1.4.0</n5-zarr.version>
108-
<n5-imglib2.version>7.0.0</n5-imglib2.version>
109-
110-
<imglib2-label-multisets.version>0.14.0</imglib2-label-multisets.version>
111102
<slf4j-api.version>1.7.36</slf4j-api.version>
112103

113104
<label-utilities.version>0.5.1</label-utilities.version>

src/main/java/org/janelia/saalfeldlab/label/spark/affinities/AverageAffinities.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.janelia.saalfeldlab.n5.DataBlock;
3535
import org.janelia.saalfeldlab.n5.DataType;
3636
import org.janelia.saalfeldlab.n5.DatasetAttributes;
37-
import org.janelia.saalfeldlab.n5.GzipCompression;
37+
import org.janelia.scicomp.n5.zstandard.ZstandardCompression;
3838
import org.janelia.saalfeldlab.n5.N5Reader;
3939
import org.janelia.saalfeldlab.n5.N5Writer;
4040
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;
@@ -211,9 +211,9 @@ public static void run(String[] argv) throws IOException {
211211
final DatasetAttributes inputAttributes = n5InSupplier.get().getDatasetAttributes(args.affinities);
212212
final N5WriterSupplier n5OutSupplier = new N5WriterSupplier(args.outputContainer, args.prettyPrint, args.disbaleHtmlEscape);
213213

214-
n5OutSupplier.get().createDataset(args.averaged, ignoreLast(inputAttributes.getDimensions()), args.blockSize, DataType.FLOAT32, new GzipCompression());
214+
n5OutSupplier.get().createDataset(args.averaged, ignoreLast(inputAttributes.getDimensions()), args.blockSize, DataType.FLOAT32, new ZstandardCompression());
215215
n5InSupplier.get().listAttributes(args.affinities).forEach(ThrowingBiConsumer.unchecked((key, clazz) -> n5OutSupplier.get().setAttribute(args.averaged, key, n5InSupplier.get().getAttribute(args.affinities, key, clazz))));
216-
n5OutSupplier.get().createDataset(args.averaged, ignoreLast(inputAttributes.getDimensions()), args.blockSize, DataType.FLOAT32, new GzipCompression());
216+
n5OutSupplier.get().createDataset(args.averaged, ignoreLast(inputAttributes.getDimensions()), args.blockSize, DataType.FLOAT32, new ZstandardCompression());
217217
n5OutSupplier.get().setAttribute(args.averaged, SUCCESS_KEY, false);
218218

219219
final Supplier<RandomAccessible<FloatType>> gliaMaskSupplier = args.gliaMask == null
@@ -389,7 +389,7 @@ private static void run(
389389
success[i] = false;
390390
try {
391391
n5out.writeBlock(averaged, attributes, block);
392-
final DataBlock<float[]> reloaded = (DataBlock<float[]>)n5out.readBlock(averaged, attributes, saveThisBlockAt);
392+
final DataBlock<float[]> reloaded = n5out.readBlock(averaged, attributes, saveThisBlockAt);
393393
success[i] = Arrays.equals(block.getData(), reloaded.getData());
394394
} catch (Exception e) {
395395
success[i] = false;

src/main/java/org/janelia/saalfeldlab/label/spark/affinities/MakePredictionMask.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.janelia.saalfeldlab.label.spark.N5Helpers;
2727
import org.janelia.saalfeldlab.n5.DataType;
2828
import org.janelia.saalfeldlab.n5.DatasetAttributes;
29-
import org.janelia.saalfeldlab.n5.GzipCompression;
29+
import org.janelia.scicomp.n5.zstandard.ZstandardCompression;
3030
import org.janelia.saalfeldlab.n5.N5Writer;
3131
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;
3232
import org.slf4j.Logger;
@@ -231,7 +231,7 @@ public static void run(String[] argv) throws IOException {
231231
final long[] validInputSizeInOutputCoordinates = convertAsLong(divide(inputSizeWorld, args.outputResolution), Math::floor);
232232

233233
final N5WriterSupplier n5out = new N5WriterSupplier(args.maskContainer, true, true);
234-
n5out.get().createDataset(args.maskDataset, outputDatasetSize, args.blockSize(), DataType.UINT8, new GzipCompression());
234+
n5out.get().createDataset(args.maskDataset, outputDatasetSize, args.blockSize(), DataType.UINT8, new ZstandardCompression());
235235
n5out.get().setAttribute(args.maskDataset, NETWORK_SIZE_DIFF_KEY, networkSizeDiff);
236236
n5out.get().setAttribute(args.maskDataset, "resolution", args.outputResolution);
237237
n5out.get().setAttribute(args.maskDataset, "offset", args.outputOffset);
@@ -279,7 +279,7 @@ private static void run(
279279
final long[] max = block._1()._2();
280280
final Interval interval = new FinalInterval(min, max);
281281
final RandomAccessible<UnsignedByteType> mask = inputMask.get();
282-
final DatasetAttributes attributes = new DatasetAttributes(outputDatasetSize, blockSize, DataType.UINT8, new GzipCompression());
282+
final DatasetAttributes attributes = new DatasetAttributes(outputDatasetSize, blockSize, DataType.UINT8, new ZstandardCompression());
283283
final double[] minReal = LongStream.of(min).asDoubleStream().toArray();
284284
final double[] maxReal = LongStream.of(max).asDoubleStream().toArray();
285285
// final Scale outputScale = new Scale(outputVoxelSize);

src/main/java/org/janelia/saalfeldlab/label/spark/affinities/SparkRain.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
import org.janelia.saalfeldlab.n5.DataBlock;
5050
import org.janelia.saalfeldlab.n5.DataType;
5151
import org.janelia.saalfeldlab.n5.DatasetAttributes;
52-
import org.janelia.saalfeldlab.n5.GzipCompression;
52+
import org.janelia.scicomp.n5.zstandard.ZstandardCompression;
5353
import org.janelia.saalfeldlab.n5.LongArrayDataBlock;
5454
import org.janelia.saalfeldlab.n5.N5Reader;
5555
import org.janelia.saalfeldlab.n5.N5Writer;
@@ -317,11 +317,11 @@ public static void run(final String... argv) throws IOException {
317317
attributes.put(OFFSET_KEY, offset);
318318

319319
final Map<String, DatasetAttributes> datasets = new HashMap<>();
320-
Arrays.asList(uint64Datasets).forEach(ds -> datasets.put(ds, new DatasetAttributes(outputDims, args.blockSize, DataType.UINT64, new GzipCompression())));
321-
Arrays.asList(uint8Datasets).forEach(ds -> datasets.put(ds, new DatasetAttributes(outputDims, args.blockSize, DataType.UINT8, new GzipCompression())));
320+
Arrays.asList(uint64Datasets).forEach(ds -> datasets.put(ds, new DatasetAttributes(outputDims, args.blockSize, DataType.UINT64, new ZstandardCompression())));
321+
Arrays.asList(uint8Datasets).forEach(ds -> datasets.put(ds, new DatasetAttributes(outputDims, args.blockSize, DataType.UINT8, new ZstandardCompression())));
322322

323323
if (args.smoothAffinitiesSigma > 0.0)
324-
prepareOutputDataset(n5out.get(), args.smoothedAffinities, new DatasetAttributes(inputDims, IntStream.concat(IntStream.of(args.blockSize), IntStream.of(1)).toArray(), DataType.FLOAT32, new GzipCompression()), attributes);
324+
prepareOutputDataset(n5out.get(), args.smoothedAffinities, new DatasetAttributes(inputDims, IntStream.concat(IntStream.of(args.blockSize), IntStream.of(1)).toArray(), DataType.FLOAT32, new ZstandardCompression()), attributes);
325325

326326
if (hasHalo) {
327327
prepareOutputDatasets(
@@ -469,8 +469,8 @@ public static void run(
469469
final ArrayImg<UnsignedLongType, LongArray> labels = ArrayImgs.unsignedLongs(parentsAndRoots.getFirst(), dims);
470470
final Interval relevantInterval = Intervals.expand(labels, negativeHalo);
471471

472-
final DatasetAttributes croppedAttributes = new DatasetAttributes(outputDims, blockSize, DataType.UINT64, new GzipCompression());
473-
final DatasetAttributes watershedAttributes = new DatasetAttributes(outputDims, watershedBlockSize, DataType.UINT64, new GzipCompression());
472+
final DatasetAttributes croppedAttributes = new DatasetAttributes(outputDims, blockSize, DataType.UINT64, new ZstandardCompression());
473+
final DatasetAttributes watershedAttributes = new DatasetAttributes(outputDims, watershedBlockSize, DataType.UINT64, new ZstandardCompression());
474474

475475
LOG.debug("Saving cropped watersheds to {}", hasHalo ? String.format(croppedDatasetPattern, watersheds) : watersheds);
476476

@@ -543,7 +543,7 @@ public static void run(
543543
final List<Point> seeds = Watersheds.collectSeeds(watershedSeedsMaskImg);
544544
LOG.debug("Found watershed seeds {}", seeds);
545545
final RandomAccessibleInterval<UnsignedByteType> watershedSeedsMaskImgUint8 = Converters.convert(watershedSeedsMaskImg, (src, tgt) -> tgt.set(src.get() ? 1 : 0), new UnsignedByteType());
546-
final DatasetAttributes croppedWatershedSeedsAtributes = new DatasetAttributes(outputDims, blockSize, DataType.UINT8, new GzipCompression());
546+
final DatasetAttributes croppedWatershedSeedsAtributes = new DatasetAttributes(outputDims, blockSize, DataType.UINT8, new ZstandardCompression());
547547
N5Utils.saveBlock(Views.interval(watershedSeedsMaskImgUint8, relevantInterval), n5Writer, hasHalo ? String.format(croppedDatasetPattern, watershedSeeds) : watershedSeeds, croppedWatershedSeedsAtributes, blockOffset);
548548
if (hasHalo) {
549549
throw new UnsupportedOperationException("Need to implement halo support!");
@@ -679,7 +679,7 @@ private static void relabel(
679679
final LongUnaryOperator idMapping) throws IOException {
680680

681681
final DatasetAttributes attributes = n5.getDatasetAttributes(dataset);
682-
final LongArrayDataBlock block = ((LongArrayDataBlock)n5.readBlock(dataset, attributes, blockPos));
682+
final DataBlock<long[]> block = n5.readBlock(dataset, attributes, blockPos);
683683
final long[] data = block.getData();
684684
for (int i = 0; i < data.length; ++i) {
685685
data[i] = idMapping.applyAsLong(data[i]);

src/main/java/org/janelia/saalfeldlab/label/spark/convert/ConvertToLabelMultisetType.java

Lines changed: 66 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
import com.google.gson.Gson;
44
import com.google.gson.GsonBuilder;
5-
import com.pivovarit.function.ThrowingSupplier;
65
import net.imglib2.FinalInterval;
76
import net.imglib2.Interval;
87
import net.imglib2.RandomAccessibleInterval;
98
import net.imglib2.algorithm.util.Grids;
109
import net.imglib2.algorithm.util.Singleton;
11-
import net.imglib2.cache.img.CachedCellImg;
1210
import net.imglib2.converter.Converters;
1311
import net.imglib2.type.NativeType;
1412
import net.imglib2.type.label.FromIntegerTypeConverter;
@@ -21,13 +19,13 @@
2119
import org.apache.http.message.BasicNameValuePair;
2220
import org.apache.spark.SparkConf;
2321
import org.apache.spark.api.java.JavaSparkContext;
22+
import org.apache.spark.api.java.function.Function0;
2423
import org.janelia.saalfeldlab.label.spark.N5Helpers;
2524
import org.janelia.saalfeldlab.n5.Compression;
2625
import org.janelia.saalfeldlab.n5.CompressionAdapter;
2726
import org.janelia.saalfeldlab.n5.DataType;
28-
import org.janelia.saalfeldlab.n5.DatasetAttributes;
2927
import org.janelia.saalfeldlab.n5.GsonUtils;
30-
import org.janelia.saalfeldlab.n5.GzipCompression;
28+
import org.janelia.scicomp.n5.zstandard.ZstandardCompression;
3129
import org.janelia.saalfeldlab.n5.N5Reader;
3230
import org.janelia.saalfeldlab.n5.N5Writer;
3331
import org.janelia.saalfeldlab.n5.imglib2.N5LabelMultisets;
@@ -45,7 +43,6 @@
4543
import java.io.IOException;
4644
import java.lang.invoke.MethodHandles;
4745
import java.net.URI;
48-
import java.net.URISyntaxException;
4946
import java.util.Arrays;
5047
import java.util.Comparator;
5148
import java.util.HashMap;
@@ -95,9 +92,6 @@ static public class CommandLineParameters implements Callable<Void> {
9592
@Option(names = {"--block-size", "-b"}, paramLabel = "BLOCK_SIZE", description = "Size of cells to use in the output N5 dataset. Defaults to 64. Either single integer value for isotropic block size or comma-seperated list of block size per dimension", split = ",")
9693
private int[] blockSize;
9794

98-
@Option(names = {"--compression", "-c"}, paramLabel = "COMPRESSION", description = "Compression type to use in output N5 dataset")
99-
public String compressionType = "{\"type\":\"gzip\",\"level\":-1}";
100-
10195
@Option(
10296
names = {"--reverse-array-attributes"},
10397
required = false,
@@ -113,10 +107,7 @@ public Void call() throws IOException {
113107
final Gson gson = new GsonBuilder()
114108
.registerTypeHierarchyAdapter(Compression.class, CompressionAdapter.getJsonAdapter())
115109
.create();
116-
final Compression compression = new GzipCompression();// .fromJson(
117-
// compressionType,
118-
// Compression.class
119-
// );
110+
final Compression compression = new ZstandardCompression();
120111
final int nDim = N5Helpers.n5Reader(this.inputN5).getDatasetAttributes(this.inputDataset).getNumDimensions();
121112
final int[] blockSize = this.blockSize.length < nDim ? IntStream.generate(() -> this.blockSize[0]).limit(nDim).toArray() : this.blockSize;
122113

@@ -168,39 +159,52 @@ public static <I extends IntegerType<I> & NativeType<I>> void convertToLabelMult
168159
final String outputGroupName,
169160
final String outputDatasetName,
170161
final Compression compression,
171-
final boolean reverse) throws IOException {
162+
final boolean reverse) {
163+
164+
final N5Reader reader = N5Helpers.n5Reader(inputGroup, blockSize);
165+
final int[] inputBlockSize = reader.getDatasetAttributes(inputDataset).getBlockSize();
166+
final Map<String, Object> attributesToCopy = resolveAttributesToCopy(reader, inputDataset, reverse);
172167

173-
final ThrowingSupplier<CachedCellImg<I, ?>, URISyntaxException> getCachedImg = () -> {
168+
final Function0<RandomAccessibleInterval<I>> imgSupplier = () -> {
174169
final URI inputGroupUri = StorageFormat.parseUri(inputGroup).getB();
175170
final String inputImgCacheKey = new URIBuilder(inputGroupUri)
176171
.setParameters(
177172
new BasicNameValuePair("call", "convert-to-label-multiset-type"),
178173
new BasicNameValuePair("dataset", inputDataset)
179174
).toString();
180-
181175
return Singleton.get(inputImgCacheKey, () -> N5Helpers.openBounded(N5Helpers.n5Reader(inputGroup, blockSize), inputDataset));
182176
};
183177

184-
final N5Reader reader = N5Helpers.n5Reader(inputGroup, blockSize);
185-
final DatasetAttributes inputDataAttrs = reader.getDatasetAttributes(inputDataset);
186-
final int[] inputBlockSize = inputDataAttrs.getBlockSize();
187-
final RandomAccessibleInterval<I> img = getCachedImg.uncheck().get();
188-
final Map<String, Class<?>> attributeNames;
189-
if (reader instanceof ZarrKeyValueReader) {
190-
attributeNames = Optional.of(reader)
191-
.map(ZarrKeyValueReader.class::cast)
192-
.map(it -> it.getZAttributes(inputDataset))
193-
.map(GsonUtils::listAttributes)
194-
.orElseGet(HashMap::new);
195-
} else {
196-
attributeNames = reader.listAttributes(inputDataset);
197-
List.of(
198-
LABEL_MULTISETTYPE_KEY,
199-
DATA_TYPE_KEY,
200-
COMPRESSION_KEY,
201-
BLOCK_SIZE_KEY,
202-
DIMENSIONS_KEY
203-
).forEach(attributeNames::remove);
178+
convertToLabelMultisetType(sc, imgSupplier, inputBlockSize, attributesToCopy, blockSize, outputGroupName, outputDatasetName, compression);
179+
}
180+
181+
public static <I extends IntegerType<I> & NativeType<I>> void convertToLabelMultisetType(
182+
final JavaSparkContext sc,
183+
final Function0<RandomAccessibleInterval<I>> imgSupplier,
184+
final int[] inputBlockSize,
185+
final int[] blockSize,
186+
final String outputGroupName,
187+
final String outputDatasetName,
188+
final Compression compression) {
189+
190+
convertToLabelMultisetType(sc, imgSupplier, inputBlockSize, new HashMap<>(), blockSize, outputGroupName, outputDatasetName, compression);
191+
}
192+
193+
private static <I extends IntegerType<I> & NativeType<I>> void convertToLabelMultisetType(
194+
final JavaSparkContext sc,
195+
final Function0<RandomAccessibleInterval<I>> imgSupplier,
196+
final int[] inputBlockSize,
197+
final Map<String, Object> attributesToCopy,
198+
final int[] blockSize,
199+
final String outputGroupName,
200+
final String outputDatasetName,
201+
final Compression compression) {
202+
203+
final RandomAccessibleInterval<I> img;
204+
try {
205+
img = imgSupplier.call();
206+
} catch (final Exception e) {
207+
throw new RuntimeException("Unable to get source image", e);
204208
}
205209

206210
final int nDim = img.numDimensions();
@@ -224,8 +228,8 @@ public static <I extends IntegerType<I> & NativeType<I>> void convertToLabelMult
224228
}
225229
writer.createDataset(outputDatasetName, dimensions, blockSize, DataType.UINT8, compression);
226230
writer.setAttribute(outputDatasetName, LABEL_MULTISETTYPE_KEY, true);
227-
for (final Entry<String, Class<?>> entry : attributeNames.entrySet())
228-
writer.setAttribute(outputDatasetName, entry.getKey(), N5Helpers.reverseInplaceAndReturn(reader.getAttribute(inputDataset, entry.getKey(), entry.getValue()), reverse));
231+
for (final Entry<String, Object> entry : attributesToCopy.entrySet())
232+
writer.setAttribute(outputDatasetName, entry.getKey(), entry.getValue());
229233

230234
final int[] parallelizeBlockSize = new int[blockSize.length];
231235
if (Intervals.numElements(blockSize) >= Intervals.numElements(inputBlockSize)) {
@@ -246,13 +250,7 @@ public static <I extends IntegerType<I> & NativeType<I>> void convertToLabelMult
246250
.map(intervalMinMax -> {
247251
final Interval interval = new FinalInterval(intervalMinMax._1(), intervalMinMax._2());
248252

249-
final URI uri = StorageFormat.parseUri(inputGroup).getB();
250-
final String imgCacheKey = new URIBuilder(uri)
251-
.setParameters(
252-
new BasicNameValuePair("call", "convert-to-label-multiset-max-id"),
253-
new BasicNameValuePair("dataset", inputDataset)
254-
).toString();
255-
final CachedCellImg<I, ?> source = Singleton.get(imgCacheKey, () -> N5Helpers.openBounded(N5Helpers.n5Reader(inputGroup, blockSize), inputDataset));
253+
final RandomAccessibleInterval<I> source = imgSupplier.call();
256254
final RandomAccessibleInterval<I> blockImg = Views.interval(source, interval);
257255

258256
final FromIntegerTypeConverter<I> converter = new FromIntegerTypeConverter<>();
@@ -280,4 +278,28 @@ public static <I extends IntegerType<I> & NativeType<I>> void convertToLabelMult
280278
Singleton.clear();
281279
writer.setAttribute(outputDatasetName, MAX_ID_KEY, maxId);
282280
}
281+
282+
private static Map<String, Object> resolveAttributesToCopy(final N5Reader reader, final String inputDataset, final boolean reverse) {
283+
final Map<String, Class<?>> attributeNames;
284+
if (reader instanceof ZarrKeyValueReader) {
285+
attributeNames = Optional.of(reader)
286+
.map(ZarrKeyValueReader.class::cast)
287+
.map(it -> it.getZAttributes(inputDataset))
288+
.map(GsonUtils::listAttributes)
289+
.orElseGet(HashMap::new);
290+
} else {
291+
attributeNames = reader.listAttributes(inputDataset);
292+
List.of(
293+
LABEL_MULTISETTYPE_KEY,
294+
DATA_TYPE_KEY,
295+
COMPRESSION_KEY,
296+
BLOCK_SIZE_KEY,
297+
DIMENSIONS_KEY
298+
).forEach(attributeNames::remove);
299+
}
300+
final Map<String, Object> resolved = new HashMap<>();
301+
for (final Entry<String, Class<?>> entry : attributeNames.entrySet())
302+
resolved.put(entry.getKey(), N5Helpers.reverseInplaceAndReturn(reader.getAttribute(inputDataset, entry.getKey(), entry.getValue()), reverse));
303+
return resolved;
304+
}
283305
}

src/main/java/org/janelia/saalfeldlab/label/spark/downsample/SparkDownsampler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static class CommandLineParameters implements Callable<Void> {
7070
private int[] maxNumEntries;
7171

7272
@Option(names = {"--compression", "-c"}, paramLabel = "COMPRESSION", description = "Compression type to use in output N5 dataset")
73-
public String compressionType = "{\"type\":\"gzip\",\"level\":\"-1\"}";
73+
public String compressionType = "{\"type\":\"zstd\",\"level\":\"3\"}";
7474

7575
@Option(names = {"-h", "--help"}, usageHelp = true, description = "display a help message")
7676
private boolean helpRequested;

src/main/java/org/janelia/saalfeldlab/label/spark/uniquelabels/ExtractAndStoreLabelList.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.janelia.saalfeldlab.label.spark.N5Helpers;
2323
import org.janelia.saalfeldlab.n5.DataType;
2424
import org.janelia.saalfeldlab.n5.DatasetAttributes;
25-
import org.janelia.saalfeldlab.n5.GzipCompression;
25+
import org.janelia.scicomp.n5.zstandard.ZstandardCompression;
2626
import org.janelia.saalfeldlab.n5.LongArrayDataBlock;
2727
import org.janelia.saalfeldlab.n5.N5Reader;
2828
import org.janelia.saalfeldlab.n5.N5Writer;
@@ -167,7 +167,7 @@ private static <I extends IntegerType<I> & NativeType<I>> long callImpl(
167167
grid.getImgDimensions(),
168168
blockSize,
169169
DataType.UINT64,
170-
new GzipCompression());
170+
new ZstandardCompression());
171171
n5writer.writeBlock(outputDataset, attributes, block);
172172
return maxVal;
173173
}

0 commit comments

Comments
 (0)