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

Use readRasters for reading Tile Data #319

Merged
merged 8 commits into from
Dec 9, 2020

Conversation

ilan-gold
Copy link
Collaborator

@ilan-gold ilan-gold commented Dec 9, 2020

As raised here: ome/bioformats#3643 (comment) it is possible that bfconvert will produce non-uniform tile sizes at lower resolutions. This PR makes us robust against that happening by using readRasters universally (which includes using it instead of truncating tiles explicitly as in #308). The downside is that we have less control over what we're doing, which is why I resisted using this API for so long; however, I think I am comfortable now given the upshot and simplification of our code. Furthermore, we should not be hitting any of the expensive conditions in readRasters here: https://github.com/geotiffjs/geotiff.js/blob/8ef472f41b51d18074aece2300b6a8ad91a21ae1/src/geotiffimage.js#L363-L387
so the performance should be identical modulo how endianness is handled (geotiff uses DataView API for that).

For an example image, http://localhost:8080/?image_url=https://viv-demo.storage.googleapis.com/AstroP65.ome.tiff breaks on master but does not now because one of its tile sizes is very odd (presumably because it was generated using bfconvert). For another example, you can download the image mentioned here: https://forum.image.sc/t/avivator-suggestion-for-improvement/46149/9?u=ilan-gold and drag-and-drop it over the canvas.

@ilan-gold ilan-gold changed the title Fall Back to readRasters if Tile Sizes Aren't Uniform Use readRasters for reading Tile Data Dec 9, 2020
@ilan-gold ilan-gold requested a review from manzt December 9, 2020 20:28
Copy link
Member

@manzt manzt left a comment

Choose a reason for hiding this comment

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

Cool. Nice to see a lot of this code pushed down to geotiff to handle.

@ilan-gold ilan-gold merged commit 14592fe into master Dec 9, 2020
@ilan-gold ilan-gold deleted the ilan-gold/fix_bfconvert_tiling_issue branch December 9, 2020 22: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.

2 participants