saalfeldlab / paintera

GNU General Public License v2.0
95 stars 17 forks source link

Cannot open zarr file with Paintera #462

Closed GenevieveBuckley closed 1 year ago

GenevieveBuckley commented 1 year ago

I am unable to read zarr image data into paintera.

I was told this should be possible, and the README says this too:

Paintera supports single and multi-channel raw data and label data from N5, HDF5, Zarr, AWS, and Google Cloud storage.

Details: Operating system: Windows 10 paintera version 0.31.1 (latest version, installed from conda-forge)

To reproduce:

  1. Create a zarr file:
    import dask.array as da
    # array of size 1000x1000 with random uint8 pixels
    data = da.random.randint(0, 255, (1000, 1000), chunks=(100, 100))
    da.to_zarr(data, test.zarr')
  2. Open paintera, and attempt to open the zarr file: File > Open > Raw/Label source > Find > Browse folders
  3. Observe the error mesage:
    path\to\test.zarr 
    A valid N5 container is a directory that contains a tile attributes.json with a key "n5".
cmhulbert commented 1 year ago

Hi @GenevieveBuckley, I did mention something to this affect, but I think I was a bit hasty. We recently (within the last year or so) updated how Paintera parses the data sources it supports, and It should be straight forward to open zarr, but currently there are some additional checks that stop Paintera from loading zarr. I think we will want to remove these sooner than later, but I don't currently have an idea of the timeline. I'm going to mark this as an enhancement for now, and use this issue to track the work. In the meantime, I will update the README to remove the mention of opening zarr projects. Sorry for the confusion!

GenevieveBuckley commented 1 year ago

Ok, no problem!

This isn't a big problem for me anyway, usually I've opened my image data in Fiji, and then used: Save As > Export N5 to convert it. The problems I've had converting and loading label data are much more of a blocker. So if you have any advice there, I'd love to hear it.

cmhulbert commented 1 year ago

@GenevieveBuckley it should be possible with the newest update to load zarr datasets now, but something to keep in mind is that the metadata still (currently) needs to match one of the accepted formats. The script you put above only outputs the data, so you would need to provide the appropriate metadata for that to work. I'll close this for now, but if there are other issues, let me know.