Skip to contents

Perform simple segmentation of multiplexed cellular images

Usage

simpleSeg(
  image,
  nucleus,
  cellBody = "dilate",
  sizeSelection = 10,
  smooth = 1,
  transform = NULL,
  watershed = "combine",
  tolerance = NULL,
  ext = 1,
  discSize = 3,
  tissue = NULL,
  pca = FALSE,
  cores = 1
)

Arguments

image

An image or list of images or CytoImageList to be read into the function.

nucleus

The marker or list of markers corresponding to the nuclei.

cellBody

Method of cytoplasm identification. Can be 'none', dilate', 'discModel' or the name of a dedicated cytoplasm marker

sizeSelection

Minimum pixels for an object to be recognized as a cell and not noise.

smooth

The amount of Gaussian smoothing to be applied to the image/s

transform

A transformation or list of transformations and normalizations to be performed prior to nuclei or cytoplasm identification. Accepted vales: "sqrt", "asinh", "norm99", "maxThresh" and "tissueMask". Tissue mask may be used when the sample does not take up the entirety of the image (typically a circular sample inside the image. When tissue mask is specified the background noise present outside the sample area is removed).

watershed

Method used to perform watersheding. Accepted values: "distance" or "combine".

tolerance

The minimum height of the object in the units of image intensity between its highest point (seed) and the point where it contacts another object (checked for every contact pixel). If the height is smaller than the tolerance, the object will be combined with one of its neighbors, which is the highest. Tolerance should be chosen according to the range of x. Default value is 1, which is a reasonable value if x comes from distmap.

ext

Radius of the neighborhood in pixels for the detection of neighboring objects. Higher value smooths out small objects.

discSize

The size of dilation around nuclei to create cell disc or capture cytoplasm

tissue

Channels to be used to create the tissue mask if specified in transforms.

pca

Whether to run PCA on aggregated nucleus markers in order to detect the cellular nucclei.

cores

The number or cores for parallel processing or a BPPARAM object

Value

A list of image masks

Examples


library(cytomapper)
data("pancreasImages")
masks <- simpleSeg(pancreasImages,
  nucleus = "H3",
  cellBody = "discModel",
  sizeSelection = 8,
  smooth = 1.2,
  transform = "sqrt",
  watershed = "combine",
  tolerance = 1, ext = 1,
  discSize = 3,
  cores = 5
)