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

Bugfix: Check the squeezed data for scale vals #60

Merged

Conversation

psobolewskiPhD
Copy link
Collaborator

This is a fix for: #54
(see also: https://forum.image.sc/t/napari-napari-aicsimageio-faild-to-open-ome-tiff/68942/2?u=sebi06)
Basically, when setting the scale metadata for napari, the original img was used, even if a singleton was squeezed. If the singleton happened to have a valid scale value, this was passed to napari, even though the dimension wasn't.
The fix here checks the physical dims of the actual squeezed xarray data for scale data, so if a dim was squeezed, but had valid scale, it will be ignored.

Pull request recommendations:

  • Name your pull request your-development-type/short-description. Ex: feature/read-tiff-files
  • Link to any relevant issue in the PR description. Ex: Resolves [admin/build-py39 #12], adds tiff file format support
  • Provide context of changes.
  • Provide relevant tests for your feature or bug fix. I think the file from @sebi06 would have failed tests previously, because the read scale meta (z, y, x) would not match expected (y, x). And obviously napari doesn't like the layer data that is passed.
  • Provide or update documentation for any feature added by your pull request.

@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2022

Codecov Report

Merging #60 (b7e8e90) into main (a7aad09) will increase coverage by 0.94%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   87.93%   88.88%   +0.94%     
==========================================
  Files           4        3       -1     
  Lines         199      189      -10     
==========================================
- Hits          175      168       -7     
+ Misses         24       21       -3     
Impacted Files Coverage Δ
napari_aicsimageio/core.py 86.15% <100.00%> (ø)
napari_aicsimageio/__init__.py

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@evamaxfield
Copy link
Collaborator

I assume lint is fixed due to the other PR. Merging! Thanks!

@evamaxfield evamaxfield merged commit fe2e53a into AllenCellModeling:main Aug 22, 2022
@psobolewskiPhD psobolewskiPhD deleted the bugfix/2D_scale_for_2D_data branch October 13, 2022 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants