EBImage feature names
1
0
Entering edit mode
Max Kuhn ▴ 60
@max-kuhn-2554
Last seen 10.2 years ago
United States

Can anyone explain what is being used to compute different features within computeFeatures?

I get the naming convention being applied that is spelled out in ?computeFeatures. I don't understand the .0., .a. and .Ba. labels.

For example:

> library(EBImage)
> 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)
> ft = computeFeatures(x, y, xname="nucleus")
> colnames(ft)
[1] "nucleus.0.m.cx"            "nucleus.0.m.cy"          
[3] "nucleus.0.m.majoraxis"     "nucleus.0.m.eccentricity"
<snip>
[11] "nucleus.0.s.radius.max"    "nucleus.a.b.mean"        
[13] "nucleus.a.b.sd"            "nucleus.a.b.mad"         
<snip>
[51] "nucleus.Ba.b.mean"         "nucleus.Ba.b.sd"         
[53] "nucleus.Ba.b.mad"          "nucleus.Ba.b.q001"       
[55] "nucleus.Ba.b.q005"         "nucleus.Ba.b.q05" 
<snip>    

My guess is nucleus.0.* features use only the data from the binary masks contained in x. So nucleus.0.m.cy is the y-axis centroid computed using the binary data. There are also nucleus.a.m.cy and nucleus.Ba.m.cy but it is unclear how these computations are different (they are extremely correlated but not identical).

I also suppose the .a. and .Ba. use the intensity values in y but the details are vague. Features like nucleus.a.b.mean and nucleus.Ba.b.mean are similar (~.80 corr) but not the same. I assume that they estimate the mean y intensity of objects defined by the labels in x but the difference is unclear.

Is there any documentation on this?

Thanks,

Max

> sessionInfo()
R Under development (unstable) (2014-08-23 r66461)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] EBImage_4.7.16

loaded via a namespace (and not attached):
 [1] abind_1.4-0         BiocGenerics_0.11.4 grid_3.2.0         
 [4] jpeg_0.1-8          lattice_0.20-29     locfit_1.5-9.1     
 [7] parallel_3.2.0      png_0.1-7           tiff_0.1-5         
[10] tools_3.2.0
ebimage • 1.5k views
ADD COMMENT
0
Entering edit mode
Andrzej Oleś ▴ 750
@andrzej-oles-5540
Last seen 4.0 years ago
Heidelberg, Germany

Dear Max,

thank you for your inquiry.

As you noted correctly, 0 represents features extracted from the binary mask only. Lower case letters a, b, c, ... stand for reference pixel matrices, which can be provided as a list or an array. For example, in case of a color image these correspond to individual R, G, B channels, respectively. You can override this naming scheme by providing your own labels using the refnames argument to combineFeatures or by setting names on ref.

Following the example above, let's assume that our reference is an RGB image. Then the two lower case letter combinations, e.g. ab, ac, bc correspond to joint channels obtained by the following transformation:

xy = (x - mean(x)) * (y - mean(y))

where x and y are the individual channels. For instance, ac represents the joint red and blue channel.

The B in front stands for reference images after applying a so-called morphological top-hat transformation to them.

The above transformations expanding the repertoire of the reference images are performed by the standardExpandRef function which can be provided as an argument to computeFeatures allowing for customization.

See the following example for an illustration:

library("EBImage")
nuc = readImage(system.file("images", "nuclei.tif", package="EBImage"))[,,1]
cel = readImage(system.file("images", "cells.tif",  package="EBImage"))[,,1]

nmask = thresh(nuc, 10, 10, 0.05)
nmask = opening(nmask, makeBrush(5, shape='disc'))
nmask = fillHull(nmask)
nmask = bwlabel(nmask)

cmask = opening(cel>0.1, makeBrush(5, shape='disc'))
cmask = propagate(cel, seeds=nmask, mask=cmask)

ref = list(n=nuc, c=cel)
expref = standardExpandRef(ref)
names(expref)
display(combine(expref))

ft = computeFeatures(cmask, ref, xname="cell")
colnames(ft)
pairs(ft[, 1:8], pch=".")

Note that you can switch between the 6 images using the arrow widgets in the Javascript GUI.

Kind regards,
Andrzej

ADD COMMENT

Login before adding your answer.

Traffic: 587 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6