-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support Mirax images #44
base: main
Are you sure you want to change the base?
Conversation
Some extra pieces of background information regarding Mirax support, that might be useful: As far as I know, the file format specification is not available and has been reverse engineered. The current best place to understand the Mirax format is this mailing list message (https://lists.andrew.cmu.edu/pipermail/openslide-users/2012-July/000373.html). An important piece of information is that there are multiple ways Mirax can store tile overlaps. I recommend getting support for the non-overlapping format to work first, and then work on supporting the other formats. My code currently handles only one of them and should crash with a NotImplementedError in the other cases. To understand the basic idea of the implementation in tiffslide, it's good to know how tiffslide currently handles access to the image data via zarr. In tiffslide Now to support Mirax, there are a few things that need to happen:
Right now (1) and (2) should work for CMU-1.mrxs from the openslide testdata repository. |
I am trying to fix the tests on the @ap-- do you remember the rational for adding this This causes the keys of the zarr Group to also be strings prefixed by an Failure in tests: https://github.com/bayer-science-for-a-better-life/tiffslide/actions/runs/3749005182/jobs/6366987967#step:6:303 Now, the following diff makes the test kaiko-ai@a87ec6c#diff-5ec7cd13afaf59c6b44cf66f33198d7dea84ec95ad4a5ae29cff9f9a00ed33c7R81 The version of packages I use: pip list
|
Should The expression is obviously not an array in those cases, so the selection with a tuple of slices fails. Should we disable this test for those inputs? |
I introduced the "s" back then to make clear that the zarr groups can be arbitrary strings. The case in which the series integer indices map directly should basically be the exception. I pushed a fix to make the tests pass and ensure that the mirax code is still working. This will all need some cleanup once the basic functionality is sufficiently implemented. I would suggest to continue by adding a test_mirax.py file with tests for locally stored mirax files. They should all be available publicly, so that everyone can reproduce behaviour. Let me know if there's further questions or if anything is unclear! Cheers, |
I think I have a basic understanding of the MIRAX format thanks to your pointers. However I'm not quite sure I understand the way you compute the key of the refs for the zarr file. if I understand correctly:
Now I don't understand why the key wouldn't be something like |
So one reason is that zarr currently does not support overlapping chunks and requires stores to have uniform tiling (chunking). Mirax files have overlap between To support overlaps, and arbitrarily offset chunks, I handle composition separately. See: https://github.com/bayer-science-for-a-better-life/tiffslide/blob/5f267c441fc0c39550d0cd4192751c5f178e6fc5/tiffslide/_zarr.py#L199-L240 Basically in this (currently naive) implementation, if composition information is available, tiffslide checks for overlaps with ALL of the |
Okay, I didn't know about the composition. This makes a lot of sense. I've pushed a PR #54 that adds testing with a MIRAX file from the openslide test file set, like the one used for SVS. Do you think the PR could be merged and a new version published after that, or do you foresee some other changes needed? |
Hey @GuillaumeDesforges, I just wanted to ask, if you had made progress on full Mirax support for tiffslide, and/or if you are still working on it. All the best, |
Hi @ap-- ! In the end I did not use Unfortunately I am not working on medical images anymore for the time being, so I won't be able to continue this effort. All the best, thank you so much for your help, support and kindness! |
Draft while work in progress.
Recommended way for initial support is going the kerchunk route. If we provide the tiffslide properties in the zarrstore this format should already be supported.
Todo:
tiffslide._kerchunk.to_kerchunk
)If anyone has time to take this over, I'm happy to provide guidance 😃