spatialdata icon indicating copy to clipboard operation
spatialdata copied to clipboard

Better support for visualising highly multiplexed images

Open berombau opened this issue 2 years ago • 2 comments

This is a tracking issue for some of the current issues when having a SpatialImage of circa >10 channels in SpatialData:

  • [ ] Vizarr, Avivator, Vitessce fail when loading SpatialImage
    • Test: Non-ome test datasets fail, except when subsetted to 3 channels. Test datasets with ome work.
    • Solution: add ome.channels in NGFF metadata (See #230, posthoc fix code here)
  • [ ] Loading a SpatialData object from disk with ome.channels NGFF metadata fails
    • Test: ome test datasets fails on SpatialData.read
    • Solution: fix channel parsing in io_raster.py maybe? (Also see #230)
  • [ ] Show scale bar when viewing image
    • Not in Vitessce though it has support, is present in vtk.js
    • Vitessce scalebar currently defaults to 1 pixel = 1 micron
    • Solution: add physical units to metadata instead of ‘unit’ when writing SpatialData (See #357, #120, #30; NGFF spec on units)
  • [x] vtk.js viewer does not work for ImageElement if the name doesn’t end in .zarr
    • Test: non vtk datasets fail, vtk dataset works
    • Solution: create issue at vtk.js (See https://github.com/Kitware/itk-vtk-viewer/issues/719)
  • [x] bug in animated-cell viewer when data does not have Z and/or T channel
    • All datasets without z or t channel fail
    • Solution: create issue at animated-cell (See https://github.com/allen-cell-animated/website-3d-cell-viewer/issues/172)

Test datasets at https://dl01.irc.ugent.be/spatial/proteomics/macsima_liver/ome_test/

Combinations of 4 different options. Ideally, SpatialData outputs ome+transform NGFF images by default and this can be read in by all viewers of OME-NGFF.

3c: subset to only 3 channels instead of 10 ome: add ome channels metadata (can no longer be read in by SpatialData) transform: add microns transformation (but still with unit: ‘unit’) (only option that passes NGFF validator) vtk: added .zarr suffix to image

HumanLiverH35.zarr NGFF validator HumanLiverH35_3c.zarr NGFF validator HumanLiverH35_ome.zarr NGFF validator HumanLiverH35_vtk.zarr NGFF validator HumanLiverH35_microns.zarr NGFF validator HumanLiverH35_3c_ome.zarr NGFF validator HumanLiverH35_3c_vtk.zarr NGFF validator HumanLiverH35_3c_microns.zarr NGFF validator HumanLiverH35_ome_vtk.zarr NGFF validator HumanLiverH35_ome_microns.zarr NGFF validator HumanLiverH35_vtk_microns.zarr NGFF validator HumanLiverH35_3c_ome_vtk.zarr NGFF validator HumanLiverH35_3c_ome_microns.zarr NGFF validator HumanLiverH35_3c_vtk_microns.zarr NGFF validator HumanLiverH35_ome_vtk_microns.zarr NGFF validator HumanLiverH35_3c_ome_vtk_microns.zarr NGFF validator

berombau avatar Nov 15 '23 16:11 berombau

Thanks for opening the issue and for the detailed information!

Solution: add ome.channels in NGFF metadata (See https://github.com/scverse/spatialdata/issues/230, posthoc fix code here)

The code seems very useful! Could you make a PR with it?

Solution: add physical units to metadata instead of ‘unit’ when writing SpatialData

Very true, we need to do it.

Show scale bar when viewing image

@melonora made a patch to napari to enable this, and also we have code for static plots to do this. So the limiting factor is to (re)enable units in transformations. It's in the agenda for this start of the year.

LucaMarconato avatar Jan 06 '24 18:01 LucaMarconato

Ideally, SpatialData outputs ome+transform NGFF images by default and this can be read in by all viewers of OME-NGFF.

Could you please elaborate a bit more on this? How would you change the output? By ensuring that the validator passes on all the datasets or by applying the transformation so that it can be removed (and then be compliant to NGFF 0.4, until 0.5 is ready)?

LucaMarconato avatar Jan 06 '24 18:01 LucaMarconato