From ba198b926aa016e97ce9382311721caf0c6c4d6f Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Tue, 17 May 2022 08:51:56 +0100 Subject: [PATCH] Also store NGFF_VERSION in plate metadata --- .../java/com/glencoesoftware/bioformats2raw/Converter.java | 1 + .../com/glencoesoftware/bioformats2raw/test/ZarrTest.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java index 31510b8..1a3fd07 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java @@ -1523,6 +1523,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); diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java index 4acb630..0006a03 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java @@ -956,6 +956,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"); @@ -1028,6 +1029,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"); @@ -1106,6 +1108,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"); @@ -1168,6 +1171,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"); @@ -1228,6 +1232,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"); @@ -1283,6 +1288,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");