Bering.plotting.Plot_Segmentation
- Bering.plotting.Plot_Segmentation(bg, cell_name, df_window_raw=None, df_window_pred=None, predictions=None, n_neighbors=10, zoomout_scale=4.0, use_image=True, pos_thresh=0.6, resolution=0.05, num_edges_perSpot=300, min_prob_nodeclf=0.3, n_iters=10, convex_hull=False)[source]
Plot the segmentation results with cell IDs on the original data and predicted data.
- Parameters:
bg (BrGraph) – Bering Graph object
cell_name (str) – Name of the cell to plot
df_window_raw (pd.DataFrame) – DataFrame of the raw spots in the window
df_window_pred (pd.DataFrame) – DataFrame of the predicted spots in the window
predictions (np.ndarray) – Array of predicted labels. This is used to identify the foreground spots.
n_neighbors (int) – Number of neighbors to build the knn graph
zoomout_scale (float) – Zoom out scale (relative to the cell diameter) to show the region
use_image (bool) – Whether to use the image to build the graph
pos_thresh (float) – Threshold to determine whether the predicted edge is positive in the segmentation step
resolution (float) – Resolution of Leiden clustering algorithm in the segmentation step
num_edges_perSpot (int) – Number of nearest edges used to investigate edge labels (positive or negative) for each spot
min_prob_nodeclf (float) – Minimum probability threshold to classify a valid cell type (otherwise background)
n_iters (int) – Number of iterations. Each iteration runs on a subset of edges. This is used to avoid memory overflow.
convex_hull (bool) – Whether to use convex hull to draw the cells