cellMask | R Documentation |
Define boundaries between adjacent cells (regions) from a
nuclear mask and optional cellular mask with the
propagate
function.
cellMask(seeds, mask = NULL, brush = NULL, lambda = 1e-04)
seeds |
An |
mask |
An optional |
brush |
Size of the brush to expand the nuclear mask as an
odd number of pixels. If this value is |
lambda |
A numeric value used by |
A mask to define approximate cellular boundaries will be created
from a nuclear mask in seeds
and an optional cytoplasmic
mask mask
. If the second argument (mask
) is NULL
,
the nuclear mask will be dilated with a disc-shaped brush of size equal
to brush
or, if brush
is NULL
, the average semi-major
axis of all nuclei. If mask
is not NULL
, mask
must be
a binary (or integer) mask defining the limits for the Voronoi segmentation
based on the seeds provided in seeds
. Such a binary mask can be
created by thresholding a non-specific widespread cytoplasmic signal such
antibody labeling for actin or a diffuse membrane stain.
To create a smaller nuclear mask, use trimMask
on a
nuclear mask with a negative brush value.
To create a cytoplasmic mask that excludes the nucleus, generate a
cell mask and combine this with the nuclear mask nmask
as shown below.
# When both are single objects: cytoplasm <- cellMask(nmask) * (nmask == 0) # When both are list objects: cytoplasm <- Map(function(a, b) a * (b == 0), cellMask(nmask), nmask)
An Image
object produced by propagate
containing the labeled objects (cells) or a list
of such objects.
x <- readImage(system.file("extdata", "by_folder/a4/file001.tif", package = "virustiter"))
y <- readImage(system.file("extdata", "by_folder/a4/file002.tif", package = "virustiter"))
nm <- nucMask(x)
cm <- cellMask(nm)
img <- rgbImage(red = normalize(y) * 0.2, green = normalize(y) * 0.8)
img <- paintObjects(nm, img, col = "cyan")
img <- paintObjects(cm, img, col = "red")
plot(img)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.