Skip to content

support 5D images but only if T=1, which means it is dropped - #1288

Open
callum-jpg wants to merge 1 commit into
scverse:mainfrom
callum-jpg:dca-5d
Open

callum-jpg wants to merge 1 commit into
scverse:mainfrom
callum-jpg:dca-5d

Conversation

@callum-jpg

@callum-jpg callum-jpg commented Oct 27, 2026 •

Copy link
Copy Markdown

The Dynamic Cell Atlas (DCA) spec defines a standard for storing microscopy datasets. An aspect of this is that all images are stored as 5D arrays, which SpatialData does not support the loading of. This PR adds support for loading of images where T=1 by dropping that dimension. If T>1, it returns an error.

Additionally, this PR also adds in the OME-Zarr 0.5 key to sdata_zarr_version_to_ome_zarr_format too, which is down to the fact that we use an external writer that is compliant with OME-Zarr 0.5.

While this PR offers a quick fix for our immediate data needs I think the eventual alignment with OME will fix the latter problem.

As for the 5D image loading case, I'm not sure of an alternative, or if dropping T=1 is even a precedent you wish to set in SpatialData. I had thought about a load-time hook, but this would mean changing args to spatialdata.read_zarr everywhere, even in a third party package (eg. SOPA).

While this PR assumes that T=1, there has been a request for time support here: #247. If that's implemented, T would be handled natively and this fix would no longer be needed.

Also, OME-Zarr lets an image omit the multiscale-level coordinateTransformations entry, where spatialdata records an image's position in space. read_zarr used to fail on such image but now it places them unchanged in the default global coordinate system. This is the cause of the test failures.

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.

1 participant