-
Notifications
You must be signed in to change notification settings - Fork 11
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 CATMAID stack info to create xarray.DataArrays #235
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clbarnes
changed the title
Use CATMAID stack info to create dask arrays
Use CATMAID stack info to create xarray.DataArrays
Jul 17, 2023
clbarnes
force-pushed
the
n5_source
branch
2 times, most recently
from
July 28, 2023 15:51
7c9bcc5
to
1830a60
Compare
This is unwieldy but necessary when a stack is not hosted in the same place as a CATMAID instance (not uncommon), or when an N5 stack is used.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces a
Stack
class which loads stack and mirror info from CATMAID. That has aget_scale
method which returns anxarray.DataArray
representing that scale level, which wraps a dask array wrapping a zarr array. Depending on the mirror info, the zarr array pulls either from an N5 store, or one of a few custom zarr store shims implementing a few of our more common tile source types (JPEG stacks, for now, but H2N5 should be fairly low-hanging fruit as well).xarray
allows us to pull data in voxel or world space.The
Stack
can be created simply from a catmaid client instance and stack ID or title (or by selection with a CLI). By default the JPEG tile sources re-use the session from that client instance (so that auth headers are re-used).Using dask arrays means we can have concurrent downloads and also do things like lazy transposes, which means we can use CATMAID's orientations. However, there is quite a lot of complexity in the interactions between N5, Zarr, and CATMAID orientations, which needs a fair bit of testing.
To do