spatialdata
spatialdata copied to clipboard
Persist color channels in `rasterize()`
Fixes scverse/spatialdata-plot#249
Please see the above spatialdata-plot issue for a problem description.
This is just a draft of how this issue could be addressed. I could see several different routes this could be tackled, including:
- splitting the tests into a separate function
- using
if schema in (Image2DModel, Image3DModel):logic instead of the currenttry: except: - using
get_channels()instead ofxdata.coords["c"].values, although this is a bit awkward sincexdatais not the correct type forget_channels(), so one would have to either modifyget_channels()or call it ondatainstead ofxdatawhich feels a little less clean
Let me know what you think!