Skip to content

Commit 076cc7c

Browse files
committed
Handle no channel_axis
1 parent 29fb252 commit 076cc7c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

napari_ome_zarr/ome_zarr_reader.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,16 @@ def metadata(self):
111111
elif contrast_limits is not None:
112112
contrast_limits.append([start, end])
113113

114-
rsp["colormap"] = colormaps
115-
rsp["name"] = ch_names
116-
rsp["contrast_limits"] = contrast_limits
117-
rsp["visible"] = visibles
114+
if rsp.get("channel_axis") is not None:
115+
rsp["colormap"] = colormaps
116+
rsp["name"] = ch_names
117+
rsp["contrast_limits"] = contrast_limits
118+
rsp["visible"] = visibles
119+
else:
120+
rsp["colormap"] = colormaps[0]
121+
rsp["name"] = ch_names[0]
122+
rsp["contrast_limits"] = contrast_limits[0]
123+
rsp["visible"] = visibles[0]
118124

119125
return rsp
120126

0 commit comments

Comments
 (0)