Repository navigation
Open zipped OME-Zarr images - #171
Merged
Merged
Conversation
Zip detection read SpatialData only and threw for any other store, so a zipped OME-Zarr image, such as the BioImage Archive's S-BIAD3559 image.ome.zarr.zip, could not be opened. A zip whose root holds multiscales (v0.4 or v0.5) or a bioformats2raw layout now opens as an image, read from the zip by byte range with the existing zip store; a .zip image URL in a manifest goes to the OME-Zarr loader. Zips holding anything else still get an error. Icechunk detection also takes a bioformats2raw root as an image.
This file contains hidden or 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
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.
Problem
Zip detection (
detectZarrZip) accepted only SpatialData. Any other zipped Zarr store threw "Only SpatialData stores are read from a zip", and the OME-Zarr loader could read only folders and Icechunk repositories. A zipped OME-Zarr image could not be opened at all. One example is the BioImage Archive's synthetic 24-plex series in S-BIAD3559:https://ftp.ebi.ac.uk/biostudies/fire/S-BIAD/559/S-BIAD3559/Files/generated/packed_parallel_1gb_10k/image.ome.zarr.zipChange
detectZarrZipreturns animagedataset (imageKind: 'ome-zarr') when the zip's root attributes holdmultiscales(v0.4),ome.multiscales(v0.5), orbioformats2raw.layout. SpatialData is still checked first. Other zips still throw, now with "neither SpatialData nor an OME-Zarr image". The predicate (isOmeZarrImageRootAttributes) is shared with Icechunk detection, which now also takes a bioformats2raw root as an image.openImageStoreinomeZarrLoader.tsopens a.zipURL with the existingopenZippedZarrStore, then applies consolidated metadata when the store has it. Because the zip's directory lists every file, a missing key costs no request.openOmeZarrMultiscaleGroupuses the same path.openImagePyramidsends.zipURLs to the OME-Zarr loader rather than the TIFF one. A manifestimageending in.zipgetsimageKind: 'ome-zarr', and naming azchunkstorealongside it is rejected, as for other OME-Zarr images.Testing
omeZarrLoader.test.ts: opens an image from a macOS-style zip (store in a folder, every entry deflated, a__MACOSX/resource fork) and reads a channel tile's pixels.datasetFactory.test.ts: a zipped OME-Zarr with alabels/group detects as an image (not as SpatialData), a bioformats2raw zip as an image, and an AnnData zip is still rejected.src/zarr,datasetFactory,datasetManifest,morphologyImageandimageOnlyDatasettests (211) pass, plus typecheck, lint and Prettier.preview.png.Not covered
The deposit's
objects/cells.enriched.geoparquetcell outlines can't be shown over the image. That needs a way to pair an image with an outlines file. The label stores named in itsmetadata.jsonwere not deposited.