bin2cell.overlay_onto_img
- bin2cell.overlay_onto_img(img, labels_sparse, cdata, key, common_objects, fill_label_weight=1, cat_cmap='tab20', cont_cmap='viridis')
Helper function used by
b2c.view_cell_labels()to actually overlay the metadata/expression onto the morphology imageInput
- image_path
numpy.array Morphology image in Numpy array form.
- labels_sparse
scipy.sparse.coo_matrix Processed to just the pixels to render,
- cdata
AnnData Cell-level VisiumHD object with pertinent gene/metadata. Must have
.obs_namesunchanged fromb2c.bin_to_cell()output.- key
str .obscolumn (float/integer or categorical) or gene name (expression taken from.X) to colour thelabels_sparsepixels by.- common_objects
numpy.arrayofint Object IDs to plot.
- fill_label_weight
float, optional (default: 1) Weight to assign the object fill render when constructing output. 0 is completely transparent, 1 is completely opaque.
- cat_cmap
str, optional (default:"tab20") Colormap name (must be understood by
seaborn.color_palette()) to use for categoricals.- cont_cmap
str, optional (default:"viridis") Colormap name (must be understood by
matplotlib.colormaps.get_cmap()) to use for integers/floats.
- image_path