From 2ed0306ad866e7a95b88834ae8fdf4d35683508c Mon Sep 17 00:00:00 2001 From: jmoore Date: Wed, 4 May 2022 11:12:40 +0200 Subject: [PATCH] Image name for single channel image --- napari_ome_zarr/_reader.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/napari_ome_zarr/_reader.py b/napari_ome_zarr/_reader.py index 51541c7..30577dd 100644 --- a/napari_ome_zarr/_reader.py +++ b/napari_ome_zarr/_reader.py @@ -133,6 +133,15 @@ def f(*args: Any, **kwargs: Any) -> List[LayerData]: np.squeeze(level, axis=channel_axis) for level in node.data ] else: + + metadata["name"] = "unnamed" + image = node.metadata.get("ome-xml:image", None) + # Pull from OME-XML metadata + if image: + metadata["name"] = image.name + + # Pull from NGFF metadata? + # TBD # Handle the removal of vispy requirement from ome-zarr-py cms = node.metadata.get("colormap", []) for idx, cm in enumerate(cms):