diff --git a/napari_ome_zarr/_reader.py b/napari_ome_zarr/_reader.py index 17001c6..295dc43 100644 --- a/napari_ome_zarr/_reader.py +++ b/napari_ome_zarr/_reader.py @@ -154,6 +154,9 @@ def f(*args: Any, **kwargs: Any) -> List[LayerData]: for x in METADATA_KEYS: if x in node.metadata: metadata[x] = node.metadata[x] + # overwrite 'name' if we have 'channel_names' + if "channel_names" in node.metadata: + metadata["name"] = node.metadata["channel_names"] else: # single channel image, so metadata just needs # single items (not lists) @@ -163,6 +166,10 @@ def f(*args: Any, **kwargs: Any) -> List[LayerData]: metadata[x] = node.metadata[x][0] except Exception: pass + # overwrite 'name' if we have 'channel_names' + if "channel_names" in node.metadata: + if len(node.metadata["channel_names"]) > 0: + metadata["name"] = node.metadata["channel_names"][0] properties = transform_properties(node.metadata.get("properties")) if properties is not None: