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

partial loading of large ome.tiff files #26

Closed
bryantChhun opened this issue May 26, 2021 · 2 comments
Closed

partial loading of large ome.tiff files #26

bryantChhun opened this issue May 26, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bryantChhun
Copy link
Contributor

problem

For very large ome.tiff files, the data loading time can be very long. This is primarily because we use tifffile library to parse the ome.xml structure and tiff page locations. Even if we open as zarr, the page locations need to be found, which requires highly iterative search through the data, even before data is loaded (zarr facilitates the lazy loading when you want the data).

this issue is running documentation of research and attempts at solving this problem

research

I created this issue on tifffile repo: cgohlke/tifffile#83
But the answer is that no high level API exists for this kind of loading and that we'd have to implement this manually.

Here is an example of someone's manual tifffile parsing to extract cropped regions of a large multi-tile image:
https://stackoverflow.com/questions/62747767/how-to-efficiently-read-part-of-a-huge-tiff-image
and the corresponding answer from Christoph
https://gist.github.com/rfezzani/b4b8852c5a48a901c1e94e09feb34743

@bryantChhun bryantChhun added enhancement New feature or request help wanted Extra attention is needed labels May 26, 2021
@bryantChhun
Copy link
Contributor Author

Consider accessing the pages directly (this requires assumptions about the underlying data, but is more performant than calls to tiff.series). Also, it's possible this is not compatible with micro-manager multi-file, ome-tiff series.

with tifffile.TiffFile(filename) as tif:
    data = tif.pages[pageindex].asarray()

cgohlke/tifffile#52

Would require some rigorous validation and testing, but could boost speed substantially.

@camFoltz
Copy link
Contributor

closed with #39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants