-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-RGB multichannels can be 3 #150
Comments
Hi @aeisenbarth, at the moment it is the case that in case of 3 or 4 channels it is interpreted as RGB. I will implement an RGB argument similar to napari which should support your usecase. |
I also found that in _get_affine_for_images_labels (on branch spatialdata), we could also inspect channel names, if these are always available for true RGB images: {"r", "g", "b"} <= set(element["scale0"].coords.indexes["c"]) # for MultiscaleSpatialImage |
These are not always available for true RGB images as far as I know. @LucaMarconato could you pitch in? |
Thanks @aeisenbarth for reporting. I think that a quick workaround would be to implement the RGB argument mentioned by @melonora to mimic the napari's functionality. I also think that the clean solution would be to rely exclusively on channel name and ensure that they are always present when needed by:
|
I could do a PR for this. I didn't find If The behavior would be unchanged for |
some like the HE in visium would be RGB |
Ok, so I propose now four PRs: spatial-image/spatial-image#21, scverse/spatialdata#342, napari-spatialdata#153, scverse/spatialdata-io#78 |
Thanks a lot for the contribution @aeisenbarth, amazing work! I have merged the PR in spatialdata, but before the others I would wait for the one in |
Images are still bright red. Can someone please have a look at the PRs? The issue will continue to persist as long as not all of them are merged.
spatialdata-plot also has this problem, I'll have to check whether it also needs a PR. |
yes we are at a hackathon currently, sorry for it taking so long! I asked @thewtex whether the PR in spatial-image can be merged. |
Yes! Done and released. |
Thanks @thewtex ! |
Thanks! Now the only blocker is this issue: scverse/spatialdata#395, I will try to address it soon. |
I will take it up this evening |
Thanksss! I'd expect that change to break many parts across all the repos, we can also split the work. Let's sync via Zulip. |
@aeisenbarth just as an update, I opened scverse/spatialdata#587 to change to the new version of |
@aeisenbarth this issue can be closed right? |
Tested, it works. Thanks @aeisenbarth @melonora. |
In pull request #115 for issue #66, a logic was implemented that converts multichannels to RGB if they are three.
In our use case, we have non-RGB channels, that can be 2, 4 or sometimes 3. The problem is that independent channels have very different value ranges and are not necessarily normalized, so that one RGB component is dominating. Furthermore, the visualization does not represent physical colors and can be misleading to the viewer.
Is there a way to set up the SpatialData object to explicitly use colors from the metadata, and avoid interpretation as RGB?
I think Napari's logic is that
c
must be 3 and additionally the order provided by the user must beyxc
to interpret an image as RGB.The text was updated successfully, but these errors were encountered: