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

Add image IO loading code from cellfinder & create image IO submodule within IO #73

Merged
merged 3 commits into from
May 15, 2024

Conversation

adamltyson
Copy link
Member

@adamltyson adamltyson commented May 13, 2024

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 72.09302% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 89.76%. Comparing base (66e88a4) to head (a1a53b5).

Files Patch % Lines
brainglobe_utils/IO/image/load.py 67.56% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
- Coverage   90.38%   89.76%   -0.62%     
==========================================
  Files          35       35              
  Lines        1393     1427      +34     
==========================================
+ Hits         1259     1281      +22     
- Misses        134      146      +12     

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

Copy link
Member

@alessandrofelder alessandrofelder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @adamltyson !

It largely looks good to me, but I noticed a potential problem around being too strict with tiff axis metadata (similar to one we had previously). I suggest applying the same approach as before (I can do it and add to this PR if you like... let me know.)

)

axes = tiff.series[0].axes.lower()
if set(axes) != {"x", "y", "z"} or axes[0] != "z":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably too strict? We missed this on initial review, but caught this on a later review of related functionality. I expect we want to be more permissive here based on previous discussions around how clean we expect TIFF metadata to be. At the very least, we should be consistent between read_z_stack and get_size_image_from_file_paths functions?

I suggest doing the equivalent of ed40e38 (#67) for read_z_stack.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code added here is just copied and pasted from cellfinder, so should these changes go into a different PR? Or did I miss something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't miss anything.
Sure, maybe it's better to put it in a different PR.
We should get that PR merged before releasing though, otherwise users that don't have xyz (in any order) in their tiff metadata will experience a change in behaviour.

@alessandrofelder alessandrofelder self-requested a review May 15, 2024 11:03
@alessandrofelder alessandrofelder merged commit 085a14c into main May 15, 2024
11 of 13 checks passed
@alessandrofelder alessandrofelder deleted the imageio branch May 15, 2024 12:10
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.

Move image_io into IO?
2 participants