napari-spatialdata
napari-spatialdata copied to clipboard
Change RGB detection to be based on channel names
See https://github.com/scverse/napari-spatialdata/issues/150
To give users more control over whether a 3/4-channel image is interpreted and visualized as RGB, channel names now need to be explicitly set to ["r", "g", "b"]. Therefore, to_spatial_image would have a new argument rgb=True to override the channel names (or auto-detect with rgb=None).
Since the condition {"r", "g", "b"} <= set(c_coords) does not require a specific order of c_coords, I should also reorder them to RGB, since that is what Napari will use. Does anyone know the corresponding xarray function (analog to transposing dimensions)?
Tests fail because multiscales blobs are not correctly set up with provided channel names. https://github.com/scverse/spatialdata/pull/342 would need to be merged first.
@aeisenbarth Thanks again, sorry it took some time