computeFeatures(x, ref, methods.noref=c("computeFeatures.moment", "computeFeatures.shape"), methods.ref=c("computeFeatures.basic", "computeFeatures.moment", "computeFeatures.haralick"), xname="x", refnames, properties=FALSE, expandRef=standardExpandRef, ...)
computeFeatures.basic(x, ref, properties=FALSE, basic.quantiles=c(0.01, 0.05, 0.5, 0.95, 0.99), xs, ...)
computeFeatures.shape(x, properties=FALSE, xs, ...)
computeFeatures.moment(x, ref, properties=FALSE, xs, ...)
computeFeatures.haralick(x, ref , properties=FALSE, haralick.nbins=32, haralick.scales=c(1, 2), xs, ...)
standardExpandRef(ref, refnames, filter = gblob())
Image
object or an array containing labelled objects.
Labelled objects are pixel sets with the same unique integer value.computeFeatures.moment
and computeFeatures.shape
.computeFeatures.basic
, computeFeatures.moment
and
computeFeatures.haralick
.x
.ref
, if present. If not,
reference intensity layers are named using lower-case letters.FALSE
, the default, the
function returns the feature matrix. If TRUE
, the function
returns feature properties.standardExpandRef
. See Details.computeFeatures
used for performance considerations.filter2
in order to add granulometry.properties
if FALSE
(by default), computeFeatures
returns a matrix of n cells times p features, where p depends of
the options given to the function. Returns NULL
if no object is
present.If properties
if TRUE
, computeFeatures
returns a matrix of p features times 2 properties (translation and
rotation invariance). Feature properties are useful to filter out
features that may not be needed for specific tasks, e.g. cell
position when doing cell classification.
cell.dna.mean
,
indicating mean DNA intensity computed in the cell or
nucleus.tubulin.cx
, indicating the x center of mass of tubulin
computed in the nucleus region. The function computeFeatures
computes sets of
features. Features are organized in 4 sets, each computed by a
different function. The function computeFeatures.basic
computes spatial-independent statistics on pixel intensities:
The function computeFeatures.shape
computes features that
quantify object shape:
The function computeFeatures.moment
computes features
related to object image moments, which can be computed with or without
reference intensities:
The function computeFeatures.haralick
computes features
that quantify pixel texture. Features are named according to
Haralick's original paper.
bwlabel
, propagate
## load and segment nucleus
y = readImage(system.file("images", "nuclei.tif", package="EBImage"))[,,1]
x = thresh(y, 10, 10, 0.05)
x = opening(x, makeBrush(5, shape='disc'))
x = bwlabel(x)
display(y, title="Cell nuclei")
display(x, title="Segmented nuclei")
## compute shape features
fts = computeFeatures.shape(x)
fts
## compute features
ft = computeFeatures(x, y, xname="nucleus")
cat("median features are:\n")
apply(ft, 2, median)
## compute feature properties
ftp = computeFeatures(x, y, properties=TRUE, xname="nucleus")
ftp
Run the code above in your browser using DataLab