Image display problems in Ilastik



I’ve been having a play around with Ilastik to identify nuclei in images of cells stained with DAPI.

The first set of images I worked with were displayed fine, I could easily distinguish the nuclei from the background.

However, when I attempted the same thing with a set of images from a different experiment the images were displayed so bright that I could not distinguish the nuclei from the much less stained cytoplasm.
Hovering the cursor over regions in which I knew the nuclei were (using the image opened in ImageJ as a guide), showed that there was a pixel intensity difference between the nuclei and the cytoplasm.

Next I tried to correct for illumination, saved the corrected file and loaded into Ilastik and some of the images displayed fine but others were too bright again. Rescaling made things worse, creating a totally black image in most cases.

Is there something really simple I am missing here? Any help would be much appreciated.


Hi @jmatthews. Based on what you’ve shared it sounds like your intuition regarding the need for normalization is correct. When an ilastik model is trained it takes it account the raw intensity values when making a classification. Illumination correction will account for within-image variation, e.g. the corners have lower exposure than the center, but it won’t correct for differences between experiments.

There are several paths to pursue:

  1. Normalize each image to fit between [0,1] or a uint16 image container. If the distribution of intensities is similar across experiments then this could be the easiest path forward. If you’re working with a DNA stain and the same cells this has a good chance of succeeding. The issue is then one of scaling, where differences in image acquisition and sample preparation have stretched and shifted the underlying true distribution. Normalization will invert stretchy and shifty transformations. You can create a CellProfiler pipeline to normalize your images, before processing them in ilastik. Since Rescaling made things worse. Perhaps you could provide more details on your method here.

  2. Train an ilastik model for every experiment. “One ilastik model to rule them all” might be unattainable due to over-fitting. This can happen if every experiment is unique unto itself and a new image set will sit outside the pooled ilastik model until the model is retrained to include this new experiment. If this is the case I think you’re better off not pooling data and instead processing each experiment independently.

  3. Optimize upstream of image acquisition. Image processing techniques are often limited by the input. Assess whether you can do anything to add additional consistency to your microscope setup and sample preparation.


P.S. If these options are dead-ends, I encourage you to upload images and your ilastik file so your challenge can be directly assessed.

Co-culture pipeline/ground truth