Multiscale ome-zarr v3 writer with sharding support#89
Multiscale ome-zarr v3 writer with sharding support#89AlanMWatson wants to merge 23 commits intomesoSPIM:masterfrom
Conversation
|
Dear Alan,
I will look into these issues more closely, jut wanted to give a quick feedback. |
|
Thank you Nikita!
I’ve added stage coordinates to the metadata for each array/scale in the multiscale tile. I tested by loading individual tiles in Neuroglancer, and they show the correct relative placement in the acquisition grid.
This was nested incorrectly; I’ve fixed it.
What do you think is the best strategy for representing the collection of tiles? It isn’t clear to me whether OME-Zarr defines a single, recommended pattern for this - if at all. With the stage coordinates embedded as described above, the tiles now connect spatially. However, there is still no metadata that defines these tiles as a collection (i.e. part of the same logical grid)... We could write zarr.json group data in the root of the acquisition directory that points to each multiscale ome-zarr for each tile. Maybe something like this: I think BigStitcher will want to see a more detailed XML which could be produced by mesoSPIM and dropped in the same place. It needs to also define "Translation to Regular Grid". Following this model, and maybe more consistant with resuability of the ome-zarr tile data, the translation coordinate transforms could be written to the root zarr.json and removed from individual tiles. That might look something like this: |
|
Dear Alan,
I started a new branch for testing ome_zarr_writer, so you can see what I changed, since I cannot push my commits directly into this PR. It currently writes @StephanPreibisch do you expect any changes to this structure in the near future? |
|
Nikitta,
It is still writing each tile in a separate
This is what I am finding as well. 'chunk key namespace' |
|
Nikitta,
I pushed a fix that will nest the multiscale tiles in a single directory. Todo: Write zarr.json group metadata in this folder. |
|
Thanks for the ping @nvladimus! First of all, this is amazing @AlanMWatson! It'll be super convenient if mesospim data is produced as OME-Zarr directly, certainly from the perspective of downstream processing and visualization.
For processing the mesospim data (that you had uploaded) using this notebook, it was required to parse the tile transformations from the bigstitcher-xml file (you probably produced it using bigstitcher)? This is because while the OME-Zarr metadata of the tiles (the same as you copied here above) do contain translation transforms, those actually don't contain the actual translations of the tiles (the non-zero entries there relate to the small offsets of the different resolution levels). So I think it'd be useful to include the tile translations in the tile OME-Zarr metadata (propagated to the resolution levels, i.e. just adding the offsets). That way, tools that support OME-Zarr transformation metadata can place the tiles properly. I.e. for a tile positioned at (z,y,x) = (100, 200, 300), the metadata would be:
@AlanMWatson Representing collections in OME-Zarr is under active development! It's currently about to be an "RFC" (I think it stands for request for comments), worked on here: ome/ngff#343
As far as I know, bigstitcher does not read pure OME-Zarr yet but only in combination with xml. Most likely bigstitcher ignores the tiles transformations in the OME-Zarr files (to be tested), so adding these there should not impact loading datasets in bigstitcher. |
|
Dear @AlanMWatson and @m-albert! |
|
Thanks @m-albert for the valuable feedback!
We are now including the stage positions in the coordinateTransformations, and I have tested it with multiview-stitcher and it works to automatically place the tiles on the grid! We can include t,c axes in all arrays by default. It should not be required by ngff spec, as I understand it, but if it adds a layer of compatibility then it may be a good idea. What do you think? As for Bigstitcher, we should see if it supports the v0.5 spec (zarr v3). If so, the 'c' directory should be fine. I did say that I would implement zarr v2 (0.4 spec) and did not get to it yet. |
…ming into 1 function
|
Hi @nvladimus, I noticed that |
|
I think I nailed the XML writer finally (took longer than I expected), the XML header file is now generated for OME ZARR v0.4 dataset, for drag-n-drop compatibility with BigStitcher. Branch: ome_zarr_writer, |
|
Hi, @AlanMWatson! |
|
Hi @nvladimus, That's great! I think ultimately whether to merge is up to you and based on your timeframe for the release. I think the plugin branch is currently working as a proof of concept, and to your point, I will try to integrate the ome zarr wrtiter asap and also reproduce a RAW writer. The branch needs some testing and discussion about the best way to structure these plugins for broad compatibility. Do you want me to submit it as a PR as is and continue development within the PR, or should I wait until it is more complete? Thanks! |
|
Merged into branch |
A builtin ome-zarr v3 writer for mesoSPIM.
Support:
Notes: