Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check OMERO color versus napari colormaps and use them if they exist #78

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

psobolewskiPhD
Copy link
Collaborator

@psobolewskiPhD psobolewskiPhD commented Jan 9, 2025

Closes: #77

Currently when an image is loaded the color from OMERO is used to create a new colormap every time.
In this PR I used a napari utility function that checks whether a colormap exists for the color and use that, else make a new colormap with the hex code of the color.
This works quite well for the images I've tested that use CYM, RGB. Nice QoL improvement.
I did run into an issue with White (which also happens for Black) where napari incorrectly doesn't realize it has that colormap (gray and gray_r) see napari/napari#7504. I've put in a workaround.

@psobolewskiPhD psobolewskiPhD added the enhancement New feature or request label Jan 9, 2025
@psobolewskiPhD psobolewskiPhD marked this pull request as ready for review January 9, 2025 21:32
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 33.01%. Comparing base (1d53966) to head (4f10b8b).

Files with missing lines Patch % Lines
src/napari_omero/plugins/loaders.py 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
- Coverage   33.13%   33.01%   -0.12%     
==========================================
  Files          13       13              
  Lines         845      848       +3     
==========================================
  Hits          280      280              
- Misses        565      568       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Images are loaded with unnamed colormap
1 participant