automated cell phenotyping — R package “EBImage”

July 5, 2012
By

(This article was first published on Tony's bubble universe » R, and kindly contributed to R-bloggers)

Counting cells under microscope is always laborious and null. Those in the art would be relieved with assistance of a powerful image processing package, EBImage. Images are treated as “Image” objects, essentially multi-dimensional arrays. The class “Image” contains spatial information, pixel intensities, color channels, etc. Image objects are easily processed or modified using matrix algebraic operators. You can read the introduction document and their paper for more information.

In general, there are four steps using EBImage to automate your counting job.

  1. read the photos into R environment with readImage();
  2. extract the channel you intend to process with channel() or just subset();
  3. filter the noise, which is important to the result;
  4. get the result, e.g. the count number, labelled photo, phenotypic features.

The resulting image is shown here.

As I mention, the third step is critical, while the rest steps are straightforward. It would be easy when the background is as clean as a blue sky. But it is hard when the background gets dirty. For this particular photo, I used three steps to remove the noisy background: use thresh() to filter out noisy pixels; use opening() to enhance the morphological shapes; remove spots with less number of pixels. It turned out very well. The original code is published here at github.

The effectiveness of this filtering step is greatly dependent on the image quality. It means if the background is a mess, there is very little room for improvement. Instead of trying a bunch of filter parameters, however, there is one alternative way which requires manual curation. Use paintObjects(opac, col) to output cell-masked images, then check the cell counts. This would leave some additional work after automated processing. So rule of thumb, why just take some clean shots of your cells?

Btw, the authors locate at EMBL. No wonder the package name looks familiar.

To leave a comment for the author, please follow the link and comment on his blog: Tony's bubble universe » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , ,

Comments are closed.