-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix color masking in Pixie #1127
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wild stuff!
If you haven't already, please read through our contributing guidelines before opening your PR
What is the purpose of this PR?
Closes #1117. Fixes colored masking for both pixel and cell clustering.
How did you implement your changes
The problem seemed to arise from non-sequential meta_cluster ids. If you change meta cluster 2 -> 21, then the IDs would be [1,3,4, ..., 21], which causes an issue when creating a colormap that expects only 20 clusters (and therefore values up to 20). However, upon further investigation, most of the cell cluster colors were being visualized incorrectly.
To ensure we are always matching the clusters correctly no matter the meta_cluster ID assignments, we
sort_values(by=['cell_meta_cluster'])
to ensure the cluster_id are generated by ascending meta cluster number every time for consistency.cluster_id
values in *_meta_cluster_mapping.csv and was instead doing it's own (second) reassignment, which was why the mapping was wrong.Old (no good) colored mask output:
New (correct) colored mask output:
Verified by me hand checking the
label
and the providedcell_meta_cluster_rename
in the cell table for a bunch of random cells in the image. 😅Remaining issues