diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java index b7de5334..2de81f9b 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/ZarrTest.java @@ -868,6 +868,27 @@ public void testHCSMetadata() throws Exception { assertEquals(1, ome.sizeOfPlateList()); } + /** + * Plate defined with no linked images. + */ + @Test + public void testEmptyPlate() throws Exception { + input = getTestFile("empty-plate.ome.xml"); + assertTool(); + + ZarrGroup z = ZarrGroup.open(output); + + // Check dimensions and block size for consistency + // with non-HCS layout + ZarrArray series0 = z.openArray("0/0"); + assertArrayEquals(new int[] {1, 1, 1, 4, 6}, series0.getShape()); + assertArrayEquals(new int[] {1, 1, 1, 4, 6}, series0.getChunks()); + + // Check OME metadata to make sure the empty plate was preserved + OME ome = getOMEMetadata(); + assertEquals(1, ome.sizeOfPlateList()); + } + /** * 96 well plate with only well E6. */ diff --git a/src/test/resources/com/glencoesoftware/bioformats2raw/test/empty-plate.ome.xml b/src/test/resources/com/glencoesoftware/bioformats2raw/test/empty-plate.ome.xml new file mode 100755 index 00000000..dd62ba82 --- /dev/null +++ b/src/test/resources/com/glencoesoftware/bioformats2raw/test/empty-plate.ome.xml @@ -0,0 +1,26 @@ + + + + + + + 2010-02-23T12:51:30 + + + /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF + + + + \ No newline at end of file