| | |
- estimate_cyto(image)
- image_log_scale(data, bottom_percentile=10, floor_threshold=50, ignore_zero=True)
- match_segmentations(cells, nuclei)
- Matches cellular and nuclear segmentation maps
The provided cells and nuclei segmentation masks are matched, and any
cell or nucleus that does not overlap with a corresponding cell/nucleus
is removed. Matching is done by nuclei, as this is typically the more
consistent segmentation mask. For each nucleus, all cells that are overlapping
are scored by the percent overlap of the nucleus inside the cell, and the highest
scoring cell is chosen as the match. Any unmatched cells or nuclei are discarded,
and both masks are relabeled to share the same indices between them.
- segment_cells(cyto, dapi, gpu=False, **kwargs)
- Segments cells using a cytoplasm and nuclear channel.
Params:
cyto: the cytoplasmic channel, numpy array of shape (width, height)
dapi: the nuclear channel, numpy array of shape (width, height)
method: str, default 'cellpose'
The method to use for cell segmentation. The available methods are:
'cellpose': Uses the 'cyto' model of cellpose to segment cells. Expects the parameter 'diameter'
'stardist': Uses stardist with only the cyto channel to segment cells
**kwargs: arguments are passed to the specified method
Returns: numpy int array of shape (width, height), where 0 is background and nonzero integers are cell masks
- segment_cyto_cellpose(cyto, dapi, diameter, gpu=False, cyto_model='cyto', logscale=True)
- segment_nuclei(dapi, method='stardist', **kwargs)
- Segments nuclei from a single channel, typically stained with DAPI or another nuclear dye
Params:
dapi: numpy array of shape (width, height)
method: str, default 'stardist'
The method of nuclear segmentation that is used. Can be:
'otsu_threshold': uses a simple otsu threshold and segments connected regions
'stardist': uses stardist to segment nuclei
**kwargs: arguments are passed onto the specific method selected
Returns: numpy array of shape (width, height), dtype int, where 0 is background and nonzero integers are cell masks
- segment_nuclei_stardist(dapi)
- #stardist_model = None
|