From bfcc47d47eb960add775e861003bb5270831ceed Mon Sep 17 00:00:00 2001 From: jmoore Date: Mon, 29 Mar 2021 15:08:18 +0200 Subject: [PATCH] ngff spec 0.2: default to nested storage This also updates the version added to the metadata based on the nested flag. In the future, this logic will need to be more sophisticated. see: https://github.com/ome/ngff/pull/40 --- README.md | 2 +- .../java/com/glencoesoftware/bioformats2raw/Converter.java | 4 ++-- .../com/glencoesoftware/bioformats2raw/test/ZarrTest.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ddfcf7d5..cc43e171 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ This option is not present in 0.3.0 and later, as only Zarr output is supported. Versions 0.2.6 and prior used the input file's dimension order to determine the output dimension order, unless `--dimension-order` was specified. -Version 0.3.0 uses the `TCZYX` order by default, for compatibility with https://ngff.openmicroscopy.org/0.1/#image-layout. +Version 0.3.0 uses the `TCZYX` order by default, for compatibility with https://ngff.openmicroscopy.org/0.2/#image-layout. The `--dimension-order` option can still be used to set a specific output dimension order, e.g.: bioformats2raw /path/to/file.mrxs /path/to/zarr-pyramid --dimension-order XYCZT diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java index 5e219cfa..80d5af7c 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java @@ -221,7 +221,7 @@ public class Converter implements Callable { description = "Whether to use '/' as the chunk path seprator " + "(false by default)" ) - private volatile boolean nested = false; + private volatile boolean nested = true; @Option( names = "--pyramid-name", @@ -1308,7 +1308,7 @@ private void setSeriesLevelMetadata(int series, int resolutions) multiscale.put("type", downsampling.getName()); } multiscale.put("metadata", metadata); - multiscale.put("version", "0.1"); + multiscale.put("version", nested ? "0.2" : "0.1"); multiscales.add(multiscale); List> datasets = new ArrayList>(); for (int r = 0; r < resolutions; r++) { diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java index 600250bf..c6637739 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java @@ -235,7 +235,7 @@ public void testMultiscalesMetadata() throws Exception { z.getAttributes().get("multiscales"); assertEquals(1, multiscales.size()); Map multiscale = multiscales.get(0); - assertEquals("0.1", multiscale.get("version")); + assertEquals("0.2", multiscale.get("version")); List> datasets = (List>) multiscale.get("datasets"); assertTrue(datasets.size() > 0); @@ -725,7 +725,7 @@ public void testDownsampleTypes(Downsampling type) throws IOException { (List>) z.getAttributes().get("multiscales"); assertEquals(1, multiscales.size()); Map multiscale = multiscales.get(0); - assertEquals("0.1", multiscale.get("version")); + assertEquals("0.2", multiscale.get("version")); Map metadata = (Map) multiscale.get("metadata");