Fast implementation of count touching cells. This version requires a new-style (label image) membrane map such as created by inForm's adaptive cell segmentation. It will not work with maps 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 to draw the phenotype dots

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.