Skip to content

Commit

Permalink
workaround for napari issue
Browse files Browse the repository at this point in the history
  • Loading branch information
psobolewskiPhD committed Jan 9, 2025
1 parent 5b25319 commit 4f10b8b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/napari_omero/plugins/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ def get_omero_metadata(image: ImageWrapper) -> dict:
for ch in channels:
# use current rendering settings from OMERO
color = ch.getColor().getHtml()

Check warning on line 81 in src/napari_omero/plugins/loaders.py

View check run for this annotation

Codecov / codecov/patch

src/napari_omero/plugins/loaders.py#L81

Added line #L81 was not covered by tests
# if the colormap exists in napari, use it
# otherwise, create a custom colormap
colors.append(ensure_colormap("#" + color))
# work around a napari bug https://github.com/napari/napari/issues/7504
if color == "000000":
colors.append(ensure_colormap("gray_r"))
if color == "FFFFFF":
colors.append(ensure_colormap("gray"))

Check warning on line 86 in src/napari_omero/plugins/loaders.py

View check run for this annotation

Codecov / codecov/patch

src/napari_omero/plugins/loaders.py#L83-L86

Added lines #L83 - L86 were not covered by tests
else:
# if the colormap exists in napari, use it
# otherwise, create a custom colormap
colors.append(ensure_colormap("#" + color))

Check warning on line 90 in src/napari_omero/plugins/loaders.py

View check run for this annotation

Codecov / codecov/patch

src/napari_omero/plugins/loaders.py#L90

Added line #L90 was not covered by tests

contrast_limits = [[ch.getWindowStart(), ch.getWindowEnd()] for ch in channels]

Expand Down

0 comments on commit 4f10b8b

Please sign in to comment.