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

Issues with TIFFWSIReader #499

Closed
jessecanada opened this issue Oct 22, 2022 · 2 comments · May be fixed by #777
Closed

Issues with TIFFWSIReader #499

jessecanada opened this issue Oct 22, 2022 · 2 comments · May be fixed by #777
Labels
bug Something isn't working stale Old PRs/Issues which are inactive

Comments

@jessecanada
Copy link

  • TIA Toolbox version: latest from the develop branch
  • Python version: 3.8
  • Operating System: Ubuntu 20.04

I have a batch of ome.tiff that are not compatible with slide_thumbnail(). Attempting to read at any level causes MemoryError. It looks like it's trying to read the base level array. The work around is to use read_bounds(), and specify the resolution=top level. For instance, a sample ome.tiff has the following dimensions:

[157521 161047]
[78760 80523]
[39380 40261]
[19690 20131]
[ 9845 10065]

This doesn't work:

thumbnail = wsi_reader.slide_thumbnail(resolution=4, units="level")
plt.imshow(thumbnail)

I get MemoryError: Unable to allocate 70.9 GiB for an array with shape (161051, 157525, 3) and data type uint8

This works:

target_level = wsi_reader_v1.info.level_count - 1
bounds = [0, 0, *wsi_reader_v1.info.level_dimensions[-1]]
thumbnail = wsi_reader.read_bounds(
    bounds,
    resolution=target_level,
    units='level'
)

However, the resulting thumbnail has shape (629, 615, 3). Is that expected behavior?

Link to sample image: http://gofile.me/6VSoS/3cPUTcMiw


Update: Interestingly, if I specify coord_space = 'resolution' in read_bounds(), then I can reproduce the same memory error. Looks like that's where the bug is.

@John-P John-P added the bug Something isn't working label Oct 28, 2022
@shaneahmed shaneahmed added the stale Old PRs/Issues which are inactive label Jun 2, 2023
@shaneahmed shaneahmed linked a pull request Feb 2, 2024 that will close this issue
@Abdol
Copy link
Collaborator

Abdol commented Feb 2, 2024

Hello @jessecanada. Could you re-share the sample file again?

@shaneahmed
Copy link
Member

We were not able to reproduce this error. Please feel free to reopen if you can provide sample images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Old PRs/Issues which are inactive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants