Segmentation pipeline for variable number of cells


I’m helping a colleague to develop a pipeline to segment human cells with fluorescent anti-body staining (abbrv. FAB). The cells are also stained with DAPI to identify the nuclei. However, I’m having a really hard time identifying cells due to the large variation in number of cells present in each site, as well as the uneven illumination in each image.

I’ve uploaded some sample images here: … C6RS2iHRHa

The pipeline I’ve tried is pretty simple (see attached): I correct the illumination of the DNA channel -> identify primary for nuclei -> correct illumination of the GFP channel -> identify secondary for cells based on nuclei -> overlay outlines and save to tif.

My tests show that I’m hugely over-segmenting. Many objects do not contain cells, both in those images that are mostly empty of cells and in those with plenty of cells. I’ve tried varying the segmentation method as well as the parameters therein, but still no improvement. Am I not doing enough to pre-process the images? Or have I not set up my segmentation modules correctly? I’d appreciate any tips that anyone can provide.


overlay_seg_jeff_test.cpproj (1.27 MB)

Hi Lee,

Yes, I see the issue, and thanks for providing a couple distinct examples. The first thing I do here is look at the intensity histograms (attached). Otsu is choosing a threshold between the two peaks - unfortunately that looks like the intensity between the well boundary(?) and the background. So a better IDPrimary thresholding method may be “Background” which uses the mode as the background intensity, which turns out here to be the “real” background intensity, afaik. If the well boundary (or whatever the dimmest portion of the image consists of) is a smaller region than the background pixels, then this will work. Otherwise you’d need to define the well boundary and then mask out those pixels.

Another method to try is 3-class thresholding for Otsu and set the middle intensity = ‘Background’.

Let us know how it goes.

Hi David,

Thanks for taking a look at this. I tried your second suggestion, with a 3 component Otsu segmentation model with the middle component assigned to background, but the results were similar (see the resulting tiffs Maybe the cells are still too dim in these images to be detected? I didn’t try masking the areas beyond the well borders since I don’t know how I might do that without doing so by hand. Can you suggest some way?

My collaborator provided me with some different sample images that are much brighter, and do not contain well borders (attached However, I’m running into a different problem; I can’t get the image sets to recognize my file name metadata. The images are named for ([0-9]{3})([0-9]{3})([0-9]{3})-([0-9]{1}).tif.

I’m trying to group the images in channel 1 as DNA, and those in channel 2 as GFP, but my pipeline (attached) claims I don’t have any valid image sets as configured. Which puzzles me, since I’m just using name-extracted metadata, and the channel name, row, col and site are all recognized. Can you reproduce this?

My CP version: 2.1.1 rev e9236fa


overlay_segmentation_newtiffs.cpproj (200 KB)

Hi Lee,
I replicated the problem with your project file, but found that if I started with a fresh project and re-did the settings in the Input modules , NamesAndTypes worked. I’ve noticed issues like this before; I think it’s caching-related.

As a side note, you can drag/drop analysis module across multiple open instances of CP so you should be able to recreate your pipeline without too much problem.