ovrlpy.cell_integrity_from_masks
- ovrlpy.cell_integrity_from_masks(ovrlp, segmentation_masks, cell_ids)
Collect VSI per cell using segmentation masks.
Get the signal strength and VSI values for each cell using their segmentation masks. The segmentation masks will be rasterized and all pixels corresponding to a cell mapped to extract VSI and signal strength values. This requires the
ovrlpy.Ovrlp.originandovrlpy.Ovrlp.gridsizeto be set (which is done automatically if processing the transcripts withovrlpy.Ovrlp.process_coordinates()).- Parameters:
ovrlp (Ovrlp)
segmentation_masks (Sequence[shapely.geometry.base.BaseGeometry]) – List of segmentation masks as shapely Geometries (e.g.,
shapely.Polygon).cell_ids (Sequence) – List of the cell IDs or labels. Must be in the same order as the segmentation masks.
- Returns:
DataFrame containing all pixels and their corresponding signal strength and VSI values per cell.
- Return type:
polars.DataFrame