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

fix bug when reading region from openslide backend at higher levels #242

Merged
merged 5 commits into from Dec 4, 2021

Conversation

jacob-rosenthal
Copy link
Collaborator

Openslide read_region() uses coords in the level 0 reference frame, but pathml uses coords according to each level. This was causing a bug when extracting regions and generating tiles from the openslide backend at higher levels (#240). This should fix it by scaling the coordinates before passing them to the openslide API.

@jacob-rosenthal
Copy link
Collaborator Author

@ryanccarelli Thoughts on how to test this? The small_HE.svs wsi only has one level, so can't really test it out on that...

@codecov-commenter
Copy link

codecov-commenter commented Nov 30, 2021

Codecov Report

Merging #242 (4f1a48a) into dev (d46a37d) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #242      +/-   ##
==========================================
+ Coverage   84.44%   84.46%   +0.01%     
==========================================
  Files          25       25              
  Lines        2405     2408       +3     
==========================================
+ Hits         2031     2034       +3     
  Misses        374      374              
Impacted Files Coverage Δ
pathml/core/slide_backends.py 96.25% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d46a37d...4f1a48a. Read the comment docs.

@jacob-rosenthal
Copy link
Collaborator Author

Thanks for adding that test file @ryanccarelli , I added a test using that file (fails on dev, passes with this fix). Ready for review and merge when the CI tests pass

@ryanccarelli ryanccarelli merged commit 8298747 into dev Dec 4, 2021
@ryanccarelli ryanccarelli deleted the generate_tiles_levels_bug branch December 4, 2021 21:13
@jacob-rosenthal jacob-rosenthal mentioned this pull request Dec 19, 2021
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.

None yet

3 participants