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

Axes swapped when using Image backend TIFFfile #187

Closed
sinberlin2 opened this issue Nov 3, 2023 · 2 comments · Fixed by #196
Closed

Axes swapped when using Image backend TIFFfile #187

sinberlin2 opened this issue Nov 3, 2023 · 2 comments · Fixed by #196
Labels
bug Something isn't working
Milestone

Comments

@sinberlin2
Copy link

Describe the bug
Tiles are sampled outside WSI bounds, causing an error. 'Requested region outside level boundaries'. This is due to axes being in the opposite order when reading in the mask using the Imagebackend TIFFfile as opposed to using ImageBackend PYVIPS.
So as an example:
self._wsi.slide_bounds (in _image.py)
Pyvips backend:
((0, 0), (3758, 2402))
Tifffile backend:
((0, 0), (2402, 3758))

To Reproduce
The issue occurs when creating a tiledroidataset from a wsi and a corresponding mask, where the mask is read in with the ImageBackened TIFFfile.

Expected behavior
The mask boundaries should be the same no matter whether it is read using ImageBackend TIFFfile or PYVIPS.

Environment
dlup version:
How installed:
Python version:
Operating System:

Additional context
Add any other context about the problem here.

@sinberlin2 sinberlin2 added the bug Something isn't working label Nov 3, 2023
@jonasteuwen
Copy link
Contributor

Hi! Can you check the behavior as well using openslide as backend?

@jonasteuwen
Copy link
Contributor

I looked at it in a bit more detail, and it's called here:

def slide_bounds(self) -> tuple[tuple[int, int], tuple[int, int]]:

So I would assume that more axis are swapped in the tiffbackend. Before we fix this, we should merge #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants