ilastik & CellProfiler interaction

CellProfiler [1] is free, open-source cell image analysis software. Its strength is in flexibly processing large numbers of images. ilastik offers a CellProfiler module (called classifyPixels) to use stored classifiers from ilastik to process images within a CellProfiler pipeline. In order to use the classifyPixels module you have to install ilastik 0.5 and CellProfiler 2.0 (note that the Matlab based CellProfiler 1 is not supported).

Apoptosis classification

The following walkthrough explains how to use an ilastik classifier inside a CellProfiler pipeline for the example task of apoptosis classification and segmentation. The nucleus of apoptotic cells appears brighter and more granular (yellow arrow) than normal interphase cells (green arrow).

Train ilastik classifier

First, you have to export the learned ilastik classifier into into an hdf5 file (.h5): after you created an ilastik project and learned the three classes background (red), normal nuclei (green), and apoptotic phenotype (yellow), you can export the classifier by clicken the Export classifier button.

Setup CellProfiler pipeline

Having exported the classifier file, you start CellProfiler and setup a pipline as exemplarily shown in the screenshot. The first module in the pipeline LoadImages just loads one example image names ist DNA.

Configure the ilastik classifyPixels module

The ClassifyPixels modules ask you to enter an input image. Select the previously loaded DNA image. Next one has to give a name to the output image in our case the probability map for apoptotic cell nuclei; we name it ApoptoticMap. In ilastik, we labeled the apoptotic cell with label class 2 (yellow), so we choose class 2. Once, we entered the previously saved classifier file ilastikClassifierFile.h5, we can proceed.

Segment apoptotic cells based on ilastik prediction

Now, we use the extracted probability map ApoptoticMap to segment and outline the cells of interest. The next module just smooths the probability map with a Gaussian to reduce spurious detections and names it ApoptoticSmothedMap.

We can use the IdentifyPrimaryObjects to extract the cell segmentation. We call the output segmentation ApoptoticOutlines. Please note, that it is usually sufficient to use a manual treshold at level 0.5 for ilastik outputs since the probability maps take values between 0 and 1.

Run the pipeline and visualize the results

The last step is to run the pipeline and displaying the result. With OverlayOutlines we can overlay the segmentation (ApoptoticOutlines) onto the original image (DNA)

Now press F5 to run the pipeline. An image with the original data and the overlayed segmentation of apoptotic cells will pop up.

If you have any questions or problems regarding the ilastik CellProfiler module, please feel free to contact us!

[1] Carpenter AE, Jones TR, Lamprecht MR, Clarke C, Kang IH, Friman O, Guertin DA, Chang JH, Lindquist RA, Moffat J, Golland P, Sabatini DM (2006) CellProfiler: image analysis software for identifying and quantifying cell phenotypes. Genome Biology 7:R100. PMID: 17076895 paper at Genome Biology