angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
71 stars 25 forks source link

Mask Generation Refactoring #1030

Closed srivarra closed 12 months ago

srivarra commented 1 year ago

If you haven't already, please read through our contributing guidelines before opening your PR

What is the purpose of this PR?

Refactors a portion of plot_pixel_cell_cluster_overlay and plot_neighborhood_cluster_result.

How did you implement your changes

Extracts the plotting functionality into a new function plot_cluster which takes a cluster mask, or any image, and colors the pixels based on a user provided colormap and normalization object. Cluster labels + colorbar can be removed from the plot as well.

Added tests for plot_neighborhood_cluster_result. Added a function which takes a numpy array representation of colors (rgb and rgba) and generates a discrete colormap from the colors provided.

Changed the readthedocs python version to 3.11 to support type hints introduced in 3.9.

Remaining issues

N/A

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

srivarra commented 1 year ago

@ngreenwald

Cell Clustering Sample Image: cell_clustering_fov1

Neighborhood Analysis Sample Image: neighborhood_analysis_fov6


I added a function which converts a numpy array to a discrete colormap. Is there any place in the notebooks for it, or is it better to leave it out of the notebooks?