AllenCellModeling / napari-aicsimageio

Multiple file format reading directly into napari using pure Python
GNU General Public License v3.0
33 stars 10 forks source link

Bugfix: Check the squeezed data for scale vals #60

Closed psobolewskiPhD closed 2 years ago

psobolewskiPhD commented 2 years ago

This is a fix for: https://github.com/AllenCellModeling/napari-aicsimageio/issues/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:

codecov-commenter commented 2 years ago

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 commented 2 years ago

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