Fast implementation of count touching cells. This function requires a membrane label image such as created by adaptive cell segmentation in inForm 2.4.3 or newer. It will not work with membrane masks created by older segmentation algorithms.

count_touching_cells_fast(
  csd,
  field_name,
  export_path,
  phenos,
  color1,
  color2,
  discard_dups = FALSE
)

Arguments

csd

Cell seg data, may include multiple fields

field_name

Sample Name or Annotation ID to process

export_path

Path to a directory containing composite, component, and segmentation image files from inForm

phenos

Named list of phenotype definitions. Must have length 2.

color1, color2

Colors for cells matching phenos.

discard_dups

If TRUE, cells matching both phenotypes will be discarded from the output. If FALSE, overlapping phenotypes is an error.

Value

Returns a list containing two items:

image

An EBImage::Image of touching cells.

data

A tibble containing data about the touching cells.