scverse / spatialdata-io

BSD 3-Clause "New" or "Revised" License
43 stars 29 forks source link

Add CLI for conversions from and to standard types (`.png`, `.tiff`, `.geojson`, ...) #231

Open LucaMarconato opened 4 weeks ago

LucaMarconato commented 4 weeks ago

If we have a single image, say a .tiff file, it would be convenient to be able to:

LucaMarconato commented 4 weeks ago

Note, we have a already a parser for .geojson data into a shapes object in ShapesModel.parse(). It could be a good starting point to move that into a CLI function.

Instead, for say .png -> .zarr conversion, the pseudocode would look something like this:

  1. use skimage.imread to read the image lazily
  2. use Image2DModel.parse to parse the image
  3. construct a SpatialData object and write it to disk.
LucaMarconato commented 4 weeks ago

In particular a very convenient use case would be to quick extract an image in, say, .png, from a Zarr store.