mechanochat.plotting.alphashape_plot3#
- mechanochat.plotting.alphashape_plot3(sem: SEM3, vis_key: str | None = None, arr: ndarray[Any, dtype[_ScalarType_co]] | Series | None = None, summary: str = 'receiver_mechano', cid_list: ndarray[Any, dtype[_ScalarType_co]] | None = None, cmap_name: str = 'Reds', palette: Dict[str, Tuple] | None = None, vmax: float | None = None, vmin: float | None = None, boundary_alpha: float = 1, face_alpha: float | List | Tuple = 1, face_alpha_arr: ndarray[Any, dtype[_ScalarType_co]] | None = None, smooth_shape: bool = False, plotter: Plotter | None = None) Plotter[source]#
Render the reconstructed 3D cell shapes with PyVista.
3D counterpart of alphashape_plot: the alpha-shape meshes in sem.shp_list (built by SEM3.compute_shape) are merged into one PolyData and colored by cell type or by a per-cell value.
- Parameters:
sem (
SEM3) – Subcellular element method object, after compute_shape().vis_key (
str, optional) – Key to retrieve visualization data from sem.adata.arr (
np.ndarrayorpd.Series, optional) –Data for visualization. shape = (nc,) or (len(cid_list),)
Ignored if vis_key is provided.
sem.ctype will be visualized if arr and vis_key both are not provided.
summary (
str, default'receiver_mechano') – Where vis_key is looked up in sem.adata: ‘gene’ for gene expression, ‘sender’ / ‘receiver’ / ‘receiver_mechano’ for the corresponding signal DataFrame in .obsm; .obs is used as a fallback.cid_list (
ndarray, optional) – Array of index for cells to be visualized. Default: all cellscmap_name (
str, default'Reds') – Valid matplotlib colormap name to visualize continuous datapalette (
dict, optional) – Category -> color mapping used for categorical data instead of the colors stored in adata.unsvmax (
float, optional) – Colormap upper bound. Default: data maxvmin (
float, optional) – Colormap lower bound. Default: data minboundary_alpha (
float, default1) – Opacity of the mesh edge colorface_alpha (
floatortuple, default1) – Face opacity. A (min, max) tuple scales the opacity with the visualized value, so that weak cells fade outface_alpha_arr (
ndarray, optional) – Explicit per-cell face opacity, overriding face_alphasmooth_shape (
bool, defaultFalse) – Subdivide and Taubin-smooth every cell before rendering. Much slower, but removes the faceted look of the raw alpha-shape. Non-manifold cells are only smoothed, not subdivided.plotter (
pyvista.Plotter, optional) – Target plotter. A new 1920x1080 notebook plotter is created if None.
- Returns:
plotter (
pyvista.Plotter) – Call .show() on it to render.