Skip to content
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

Towards support for ome.zarr #52

Closed
7 tasks done
constantinpape opened this issue Jun 2, 2021 · 12 comments
Closed
7 tasks done

Towards support for ome.zarr #52

constantinpape opened this issue Jun 2, 2021 · 12 comments

Comments

@constantinpape
Copy link
Contributor

constantinpape commented Jun 2, 2021

Add "prototype" support for ome.zarr fle format:

  • Implement new file format spec, see Add support for different file formats to spec #49
  • Add ome.zarr to the spec
  • Create an example project based on ome.zarr v0.3 (with bdv xml)
  • Enable opening this with MoBIE Fiji
  • Create an example project without bdv xml
  • Enable opening this in MoBIE
  • (Enable writing ome.zarr with MoBIE project creator)

I will work on the first 3 points, @KateMoreva will work on implementing the reader in MoBIE (once I have created the example project!).
The last point would probably be done by @K-Meech, but I am not sure if we need to work on this already, I just added it here for completeness.

cc @joshmoore: this will also serve as example data and reader for v0.3.

@constantinpape
Copy link
Contributor Author

I started to work on this:

@constantinpape
Copy link
Contributor Author

I have created an example project with "bdv.ome.zarr" and "bdv.ome.zarr.s3" formats. This means the data is in ome.zarr format, but we are still using a bdv xml file in MoBIE, because we can't save the voxel size in ome.zarr yet (for v0.3).
The example project is available:

The available image data (ome.zarr and xml files) can be found in the folder Covid19-S4-Area2/images/bdv.ome.zarr.
So we can already start with adapting the readers in MoBIE:

From filesystem

Goal: the fiji command to open ome.zarr from the filesystem should work with the raw.ome.zarr file.

What needs to be adapted for the ome.zarr v3 format (list of necessary changes may not be exhaustive):

  • The transform field does not exist, but the current code should still work, because it uses try-excepts, e.g here and here.
  • The data can now have variable dimensions from 2d to 5d. We should check that we can read the data, by ensuring that the axes field contains
    ["z", "y", "x"], i.e. is 3 dimensional. And we need to get rid of other 5d changes, e.g. here.

From s3

Goal: the fiji command to open ome.zarr from s3 should work for loading the raw.ome.zarr file from s3.

This should not require any additional changes once the filesystem version works.

Next steps

Once mobie/mobie-viewer-fiji#293 is merged, we can add the bdv.ome.zarr and bdv.ome.zarr.s3 file formats and integrate the loaders with the mobie spec, so that the example project can be loaded in MoBIE (both from the filesystem and from s3).

@constantinpape
Copy link
Contributor Author

constantinpape commented Jun 10, 2021

The PR mobie/mobie-viewer-fiji#297 is progressing and I think we should have a first version that can read the example data tomorrow or early next week.

Once that works and is cleaned up a bit we should make a larger clean up and extension of the (ome) zarr readers:

  • Add n5-zarr as dependency and remove the code that was copied from there, e.g. the N5ZarrReader
  • Read dimensionSeparator from the zarr .attrs instead of hard-coding it. (Using "." as default if it's not there.)
  • Generate additional example data for: axes=["y", "x"], ["c", "y", "x"], ["c", "y", "x"], ["t", "c", "y", "x"], ["t", "c", "z", "y", "x"] and for dimensionSeparator=".". (I will do this.)
  • Extend the ome-zarr functionality so that all the examples can be read properly.

@constantinpape
Copy link
Contributor Author

I have generated ngff example data for all the different axes combinations now.
It's available on:

  • embl share: /g/kreshuk/data/ngff/v.03
  • s3: https://s3.embl.de/i2k-2020/ngff-example-data/v0.3

@constantinpape
Copy link
Contributor Author

I have now also added a project that uses the "ome.zarr" data format (in contrast to "bdv.ome.zarr" this does not have an additional xml and all image metadata is read directly from the zarr file): https://github.com/mobie/covid-if-project.
The project with all data is here: /g/kreshuk/pape/Work/mobie/covid-if-project (I haven't uploaded it to s3 yet and it's to large to zip and upload to owncloud).

@constantinpape
Copy link
Contributor Author

@tischi, I just discussed how to continue here with @KateMoreva:

@tischi
Copy link
Contributor

tischi commented Jul 12, 2021

I can open the project with the current master, using this:

 new MoBIE("https://s3.embl.de/i2k-2020/project-bdv-ome-zarr", MoBIESettings.settings().imageDataFormat(ImageDataFormat.OmeZarr));

Is there a reason why this is not called ImageDataFormat.BdvOmeZarrN5?

@constantinpape
Copy link
Contributor Author

Is there a reason why this is not called ImageDataFormat.BdvOmeZarrN5?

I think it should be called ImageDataFormat.BdvOmeZarr.
The fact that we use n5 for opening is an implementation detail, that should not be part of the format name.

@tischi
Copy link
Contributor

tischi commented Jul 12, 2021

Sorry, I meant: ImageDataFormat.BdvOmeZarrS3

@KateMoreva
Copy link

I can open the project with the current master, using this:

 new MoBIE("https://s3.embl.de/i2k-2020/project-bdv-ome-zarr", MoBIESettings.settings().imageDataFormat(ImageDataFormat.OmeZarr));

Is there a reason why this is not called ImageDataFormat.BdvOmeZarrN5?

Yes, it should be named BdvOmeZarr once MoBIE could open ome.zarr files (not bdv.ome.zarr). I can push renamed files and some more changes right now if you wish (but so far MoBIE can open only BbvOmeZarr, thus the name was just OmeZarr)

@constantinpape
Copy link
Contributor Author

Quick summary from a meeting with @KateMoreva and @tischi:
the progress on this is great and we can read all current flavors of ome.zarr now (except for from ome.zarr.s3, but only because this is missing an example project, which I will provide). The next step will be to continue refactoring this functionality into the two separate "bigdataviewer-n5" and "bigdataviewer-ome-zarr" repositories:
Whiteboard 1 -01

The next steps for this are (not necessarily in this order):

  • refactor most of the functionality in https://github.com/mobie/mobie-viewer-fiji/tree/master/src/main/java/de/embl/cba/mobie/n5 into the new repositories (except for openOrganelle, which is still experimental and the Fiji commands, which we will keep inside of MoBIE for now and could refactor into some other repository with more lightweight dependencies if needed later)
  • create maven packages for the two new repos and host them via the imagej maven repository, @tischi will contact Jan Eglinger about this.
  • add examples and tests (for proper CI) to the two repositories

@constantinpape
Copy link
Contributor Author

@KateMoreva I have created the example project for ome.zarr.s3 now:
https://s3.embl.de/i2k-2020/project-ome-zarr.

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

No branches or pull requests

3 participants