8000 Enforce minimum side length when guessing if image is RGB by jni · Pull Request #7273 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enforce minimum side length when guessing if image is RGB #7273

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

Merged
merged 5 commits into from
Sep 22, 2024

Conversation

jni
Copy link
Member
@jni jni commented Sep 16, 2024

References and relevant issues

Closes #7261

Description

For the vast majority of user RGB images, the side length would be larger than 30 pixels. (For reference, our layer thumbnails are 32x32.) Therefore, we can reduce or avoid issues like #7261 by enforcing a minimum side length before we use the final dim as an RGB dim.

I've implemented this as a parameter on the guess_rgb function, which allows us
to turn this into a preference in the future.

jni added 2 commits September 16, 2024 10:04
For the vast majority of user RGB images, the side length would be larger than 30 pixels. (For reference, our layer thumbnails are 32x32.) Therefore, we can reduce or avoid issues like napari#7261 by enforcing a minimum side length before we use the final dim as an RGB dim.
@github-actions github-actions bot added the tests Something related to our tests label Sep 16, 2024
@jni jni added this to the 0.5.4 milestone Sep 16, 2024
@jni jni requested review from psobolewskiPhD and removed request for andy-sweet September 16, 2024 00:09
@jni
Copy link
Member Author
jni commented Sep 16, 2024

@DragaDoncila I know you don't like this but I do think it's going to be a significant user improvement with limited risk. We can make it a preference in the near future so that users can configure this behaviour to suit their data.

@jni
Copy link
Member Author
jni commented Sep 16, 2024

(and turn it off altogether if they don't want us guessing! Adding an action to un-rgb an image would be a good additional fix.)

@jni jni requested a review from a team as a code owner September 16, 2024 01:39
jni added 2 commits September 16, 2024 12:41
We should be able to override the magic guess if rgb is manually set to True.
Copy link
codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.74%. Comparing base (15c2d7d) to head (88a78ba).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7273      +/-   ##
==========================================
- Coverage   92.84%   92.74%   -0.10%     
==========================================
  Files         623      623              
  Lines       57114    57127      +13     
==========================================
- Hits        53025    52983      -42     
- Misses       4089     4144      +55     

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

@Czaki Czaki added bugfix PR with bugfix ready to merge Last chance A8DE for comments! Will be merged in ~24h labels Sep 16, 2024
@jni jni merged commit ffb8e8f into napari:main Sep 22, 2024
44 checks passed
@jni jni deleted the guess-rgb-plus branch September 22, 2024 01:04
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Napari incorrectly adding 3D image as 2D RGBD to viewer
2 participants
0