-
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
color legend for categorical annoation in table #242
Comments
So regarding the different indices, this is because 0 is usually seen as background. As for which categories are there, I have thought of this before and I think providing hover tooltip functionality based on which column the user is coloring would benefit here. I just didn't have time yet with the recent annotation_widget work:) So TLDR no not yet, but it is in our radar. |
Another user (@gboscagli) reported this issue so I looked better into this. I used this code: ##
from spatialdata.datasets import blobs_annotating_element
from napari_spatialdata import Interactive
import spatialdata as sd
sdata = blobs_annotating_element('blobs_labels')
##
labels = sdata['blobs_labels']
print(sd.get_element_instances(labels))
sdata['table'].obs.index = list(map(str, [100, 101, 102, 103, 104]))
print(sdata['table'].obs)
print(labels.data.compute().tolist())
Interactive(sdata) These are the outputs of the first 2 prints.
And in the screenshot you can see the output of the third print and the napari plot. What I see from napari is correct:
Therefore my conclusions are:
|
Hi @LucaMarconato, I also tried with the blobs data with the following code:
These are the outputs of the prints:
And a screenshot of napari plot, where my cursor is pointing at the greenish label#3: It reads the label value correctly and the color is correct. But the values from the table cannot be read, as shown [No Properties] in the status bar. The status bar becomes this when i move the cursor to the background where instance_id = 0: Of a side note, we put the
|
@LucaMarconato @melonora
As a reference, I leave here the print of the
As you can see from the image, I have the pointer over the blob 4, as per the Moreover, if I place myself over the blob 6, the value is I would stress on the fact that colors are actually correct, so no problem for an overall visualization. However, to visualize the relative annotation, Napari seems to refer to the index of obs and it's kinda misleading: this problem is consistent with what @ynanli found out, but i think it's not dependent on the subsetting since I didn't perform any. |
Thanks for the example, I just tried reproducing but as you can see from my initial screenshot, I don't see the last part in the status bar e.g. @ynanli @gboscagli which versions of I am using |
Hi, no need to send the versions. I made a fix in this PR: #320 Two comments:
|
CC @berombau (tagging you since you mentioned this issue once): I am merging a fix now. |
Hi,
I am using the viewer to visualize the categorical labels in the table (e.g., cell types) from steinbock-generated data. The viewer plots perfectly, even with a subsetted table. However, it is hard to figure out which labels they are on the image as they are color-coded without a legend.
I tried to look at the values shown in the viewer but without success. The indices of the table and label image start differently (0 for image, 1 for table), and it becomes even worse with the subsetted table.
I included a snapshot of the viewer with a subsetted table. My cursor was on one of the orange cells. Is there a way to figure out what these colors mean? Many thanks!
The text was updated successfully, but these errors were encountered: