At the moment I am working on automated image analysis to have high throughput phenotypes for QTL analysis and genomic prediction.
Therefore, I looked for R-packages which help in analysing photos. One of these is the EBImage package of Bioconductor. I have a question regarding the computeFeatures function of EBImage. I used the following code to compute the features for a test-image (The vignette uses cells under the microscope).
biocLite("EBImage") library (EBImage) Image <- readImage("test.jpg") Image3<-getFrame(Image,3) x = thresh(Image3, w=15, h=15, offset=0.05) x = opening(x, makeBrush(5, shape='disc')) x = bwlabel(x) fts = computeFeatures.shape(x)
This gives me a list of the computed features. However, this is a list of 39 features, and I am only interested in a few of them. Thus I would like to know which of the computeFeatures correspond to each features in the image.
A solution was presented at http://www.bricol.net/research/leafranks/11-01MS/EBImage-introduction.pdf by using the following code:
> nmask = thresh(nuc, 10, 10, 0.05) > nmask = opening(nmask, makeBrush(5, shape='disc')) > nmask = fillHull(nmask) > nmask = bwlabel(nmask) Cell bodies are segmented using propagate. > ctmask = opening(cel>0.1, makeBrush(5, shape='disc')) > cmask = propagate(cel, nmask, ctmask) > res = paintObjects(cmask, img, col='#ff00ff') > res = paintObjects(nmask, res, col='#ffff00') > xy = lapply(hullFeatures(cmask), function(hf) hf[, c('g.x', 'g.y')]) > labels = lapply(xy, function(z) as.character(1:nrow(z))) > font = drawfont(weight=600, size=16) > res = drawtext(res, xy=xy, labels=labels , font=font, col="white")
Which plots numbers corresponding to the features on the Image. However, the function hullFeatures is no longer available.
Thus, is there an other way to plot the number of the features or objects in the Image?