findObjects: Find Objects

View source: R/findObjects.R

findObjectsR Documentation

Find Objects

Description

Identify objects in data.frame produced by parseImages as specified by the expression expr.

Usage

findObjects(expr, df, mask = NULL, invert = FALSE)

Arguments

expr

An expression evaluated in the data frame df that returns a logical vector identifying objects (rows) in df.

df

A data.frame produced by parseImages in which 'expr' will be evaluated.

mask

An optional Image object in Grayscale mode or an array containing object masks. Object masks are sets of pixels with the same unique integer value.

invert

A logical value to invert the selection determined by expr.

Details

The data frame must have the variable frame and either well file or tag. If more than one these three variables are present, the longest of these three factors will be used to split the data before finding objects.

Value

If a mask was provided, the function will return an integer Image mask or list of integer Image masks with the objects selected by expr. If no mask was provided, a nested list of integers will be returned that identifies the objects satisfying the argument in expr.

Examples

  x <- getImages(system.file("extdata", "by_folder/b4", package = "virustiter"))
  nm0 <- nucMask(x$nuc)
  df0 <- parseImages(x$nuc, x$tgt, nm0)
  nm1 <- findObjects(area > 190 & area < 220, df0, nm0)
  a <- Map(paintObjects, nm1, lapply(x$nuc, function(v) toRGB(normalize(v))))
  plot(a$b4, all = TRUE)


ornelles/virustiter documentation built on March 29, 2024, 8:30 p.m.