napari-spatialdata icon indicating copy to clipboard operation
napari-spatialdata copied to clipboard

Change RGB detection to be based on channel names

Open aeisenbarth opened this issue 2 years ago • 2 comments

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).

aeisenbarth avatar Aug 24 '23 19:08 aeisenbarth

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)?

aeisenbarth avatar Aug 24 '23 19:08 aeisenbarth

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 avatar Aug 24 '23 19:08 aeisenbarth

@aeisenbarth Thanks again, sorry it took some time

melonora avatar Jul 22 '24 11:07 melonora