From 5409de6a76a2a1fd437917cf0ec6b3bac36660d1 Mon Sep 17 00:00:00 2001 From: jluethi Date: Mon, 16 Sep 2024 13:50:00 +0200 Subject: [PATCH] Add catch for 4D label images --- src/napari_ome_zarr_navigator/ome_zarr_image.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/napari_ome_zarr_navigator/ome_zarr_image.py b/src/napari_ome_zarr_navigator/ome_zarr_image.py index bf2d078..8d77882 100644 --- a/src/napari_ome_zarr_navigator/ome_zarr_image.py +++ b/src/napari_ome_zarr_navigator/ome_zarr_image.py @@ -422,6 +422,11 @@ def load_label_roi( img_multiscale=self.image_meta.multiscale, ) + # Hacky way to address + # https://github.com/fractal-napari-plugins-collection/napari-ome-zarr-navigator/issues/14 + # Handle 4D label arrays + subset = 0 if label_multiscale.axes[0].name == "c" else None + return self.load_zarr_array_index_based( zarr_url=zarr_url_label, roi_table=roi_table, @@ -429,6 +434,7 @@ def load_label_roi( multiscale=label_multiscale, level_path=level_path, as_np=as_np, + subset=subset, ) def get_omero_metadata(self, channel_name: str):