scallops.segmentation.propagation.segment_cells_propagation
- scallops.segmentation.propagation.segment_cells_propagation(image, nuclei, threshold='Li', cyto_channel=None, threshold_correction_factor=1, nuclei_channel=0, rm_small_std=None, rolling_ball=False, sigma=None, closing_radius=None, t=0, regularization_factor=0.05, fill_holes=True, chunks=None, depth=30)
Segment cells using propagation algorithm, matching cell labels to nuclei labels.
- Parameters:
image (DataArray) – Image with the dimensions (t, c, z, y, x)
nuclei (ndarray) – Labeled segmentation mask of nuclei. Uses nuclei as seeds and matches cell labels to nuclei labels.
cyto_channel (int | Sequence[int] | None) – Index or list of indices for cyto channel(s). If not provided, all channels except for nuclei_channel are used.
threshold (Literal['Li', 'Otsu', 'Local'] | float) – One of Li, Otsu, or float value If Li, use Li’s iterative Minimum Cross Entropy method
threshold_li(). If Otsu, use Otsu’s methodthreshold_otsu().threshold_correction_factor (float) – Factor to adjust the computed threshold by.
threshold – Threshold to apply to cell mask.
nuclei_channel (int) – DAPI channel index
rm_small_std (float | None) – If specified, remove objects smaller than specified number of standard deviations of identified nuclei
rolling_ball (bool) – If true, apply skimage.restoration.rolling_ball subtraction to mask prior to calculating threshold
sigma (float | None) – sigma (optional) gaussian filter sigma to smooth the image prior to computing threshold
closing_radius (int | None) – (optional) disk radius for closing cell labels
t (list[int] | int | None) – Optional list of time indices (0-based) to use for computing cell mask
regularization_factor (float) – If method is propagation, takes two factors into account when deciding where to draw the dividing line between two touching secondary objects: the distance to the nearest primary object, and the intensity of the secondary object image
fill_holes (bool) – Fill holes inside labels
chunks (tuple[int, int] | None) – Chunk size to perform segmentation using non-overlapping chunks.
depth (int) – The number of elements that each block should share with its neighbors when using dask
- Returns:
Cell labels matching nuclei labels and thresholds if an auto threshold method is used.
- Return type:
tuple[ndarray, float | ndarray | None]