diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java index f79303f..c76d773 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java @@ -115,6 +115,9 @@ public class Converter implements Callable { /** Version of the bioformats2raw layout. */ public static final Integer LAYOUT = 3; + /** NGFF specification version.*/ + public static final String NGFF_VERSION = "0.4"; + @Parameters( index = "0", arity = "1", @@ -426,6 +429,7 @@ public Void call() throws Exception { ).orElse("development"); System.out.println("Version = " + version); System.out.println("Bio-Formats version = " + FormatTools.VERSION); + System.out.println("NGFF specification version = " + NGFF_VERSION); return null; } @@ -1525,6 +1529,7 @@ private void saveHCSMetadata(IMetadata meta) throws IOException { plateMap.put("rows", rows); plateMap.put("field_count", maxField + 1); + plateMap.put("version", NGFF_VERSION); Map attributes = root.getAttributes(); attributes.put("plate", plateMap); @@ -1576,7 +1581,7 @@ private void setSeriesLevelMetadata(int series, int resolutions) multiscale.put("type", downsampling.getName()); } multiscale.put("metadata", metadata); - multiscale.put("version", nested ? "0.4" : "0.1"); + multiscale.put("version", nested ? NGFF_VERSION : "0.1"); multiscales.add(multiscale); IFormatReader v = null; diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java index dda8d77..27f4aaf 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java @@ -962,6 +962,7 @@ public void testHCSMetadata() throws Exception { Map plate = (Map) z.getAttributes().get("plate"); assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue()); + assertEquals("0.4", plate.get("version")); List> acquisitions = (List>) plate.get("acquisitions"); @@ -1034,6 +1035,7 @@ public void testHCSMetadataNoAcquisitions() throws Exception { Map plate = (Map) z.getAttributes().get("plate"); assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue()); + assertEquals("0.4", plate.get("version")); List> rows = (List>) plate.get("rows"); @@ -1112,6 +1114,7 @@ public void testSingleWell() throws IOException { Map plate = (Map) z.getAttributes().get("plate"); assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue()); + assertEquals("0.4", plate.get("version")); List> acquisitions = (List>) plate.get("acquisitions"); @@ -1174,6 +1177,7 @@ public void testTwoWells(String resourceName) throws IOException { Map plate = (Map) z.getAttributes().get("plate"); assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue()); + assertEquals("0.4", plate.get("version")); List> acquisitions = (List>) plate.get("acquisitions"); @@ -1234,6 +1238,7 @@ public void testOnePlateRow() throws IOException { Map plate = (Map) z.getAttributes().get("plate"); assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue()); + assertEquals("0.4", plate.get("version")); List> acquisitions = (List>) plate.get("acquisitions"); @@ -1289,6 +1294,7 @@ public void testSingleWellTwoAcquisitions() throws IOException { Map plate = (Map) z.getAttributes().get("plate"); assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue()); + assertEquals("0.4", plate.get("version")); List> acquisitions = (List>) plate.get("acquisitions");