brainglobe / brainglobe-utils

Shared general purpose tools for the BrainGlobe project
MIT License
11 stars 1 forks source link

handle nii.gz correctly #93

Closed alessandrofelder closed 1 month ago

alessandrofelder commented 1 month ago

Description

What is this PR

Why is this PR needed?

save/load_any in Image IO was raising an error when passed a compressed nifti file (.nii.gz) - (but save/load_nii works with these files perfectly fine).

What does this PR do?

In the save/load_any functions, this PR adds handling the case of compressed nifti files appropriately.

References

Closes https://github.com/brainglobe/brainglobe-utils/issues/89

How has this PR been tested?

Improved tests, to cover this case, were added and pass locally.

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.68%. Comparing base (7098eb8) to head (f5eb737).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #93 +/- ## ======================================= Coverage 92.68% 92.68% ======================================= Files 37 37 Lines 1845 1845 ======================================= Hits 1710 1710 Misses 135 135 ``` | [Flag](https://app.codecov.io/gh/brainglobe/brainglobe-utils/pull/93/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe) | Coverage Δ | | |---|---|---| | [numba](https://app.codecov.io/gh/brainglobe/brainglobe-utils/pull/93/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe) | `92.62% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=brainglobe#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.