spateo.segmentation.external.deepcell#

Use DeepCell for cell identification and labeling. https://github.com/vanvalenlab/deepcell-tf

[Greenwald21]

Module Contents#

Functions#

_deepcell(→ numpy.ndarray)

Run DeepCell on the provided image.

deepcell(adata[, model, equalize, layer, out_layer])

Run DeepCell to label cells from a staining image.

Attributes#

spateo.segmentation.external.deepcell.Application[source]#
spateo.segmentation.external.deepcell._deepcell(img: numpy.ndarray, model: deepcell.applications.Application, **kwargs) numpy.ndarray[source]#

Run DeepCell on the provided image.

Parameters:
img

Image as a Numpy array.

model

DeepCell model to use

**kwargs

Additional keyword arguments to Application.predict() function.

Returns:

Numpy array containing cell labels.

spateo.segmentation.external.deepcell.deepcell(adata: anndata.AnnData, model: deepcell.applications.Application | None = None, equalize: float = 2.0, layer: str = SKM.STAIN_LAYER_KEY, out_layer: str | None = None, **kwargs)[source]#

Run DeepCell to label cells from a staining image.

Parameters:
adata

Input Anndata

model

DeepCell model to use

equalize

Controls the clip_limit argument to the clahe() function. Set this value to a non-positive value to turn off equalization.

layer

Layer that contains staining image. Defaults to stain.

out_layer

Layer to put resulting labels. Defaults to {layer}_labels.

**kwargs

Additional keyword arguments to Application.predict() function.

Returns:

Numpy array containing cell labels.