nucMask: Generate Nuclear Mask from DNA Image

View source: R/nucMask.R

nucMaskR Documentation

Generate Nuclear Mask from DNA Image

Description

Generate an integer Image mask from a fluorescent DNA image.

Usage

nucMask(
  dna,
  width = 36,
  offset = 0.05,
  size = 2,
  sigma = 2,
  radius = NULL,
  gamma = 1
)

Arguments

dna

Fluorescent DNA Image or list of fluorescent DNA Images.

width

Maximum nuclear diameter (in pixels) to be used as the width parameter for thresh2.

offset

Offset parameter for thresh2. Use 0.05 for typical images, use 0.01 for low contrast images.

size

Radius (in pixels) for medianFilter as an integer. Use 2 for typical images, use 0 to skip medianFilter.

sigma

Standard deviation for gblur, use 2 for typical images, use 5 for finely detailed images.

radius

Radius for gblur, use default value of 2 * ceiling(3 * sigma) + 1 for typical images, use numbers smaller than the default of 13 for images with smaller nuclei.

gamma

Exponent used for DNA^gamma transformation.

Details

Generate an integer object mask (or list of masks) representing segmented nuclei. The argument nuc must be a grayscale nuclear image of one or more dimensions or a list of such images.

Optimal conditions for detecting and segmented nuclei may require empirically adjusting the arguments, especially width and offset.

The image or images will be processed sequentially by (1) an optional gamma transformation, (2) normalization, (3) a medianFilter with argument size if size is non-zero, (4) the gblur filter with arguments sigma and radius, (5) thresholding with thresh2 with arguments width and offset, (6) fillHull, (7) distmap, and (8) watershed.

Value

An integer Image mask or list of integer Image masks.

Examples

  f.ex <- system.file("extdata", "by_folder/b2/file003.tif",package = "virustiter")
  nuc.ex <- readImage(f.ex) # single nuclear image
  xm0 <- nucMask(nuc.ex)
  plot(colorLabels(xm0))


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