Help Needed Counting Nuclei in CellProfiler3

Hello -

I have been trying for some time to create a pipeline that identifies H2B-GFP stained cell nuclei, and no matter how I preprocess my pipeline, I cannot get accurate counts. I am much closer than I was a few months ago, but I am really having trouble removing false positives and further narrowing down the accuracy of my analysis pipeline.

I also cannot get Cell Profiler Analyst to launch because creating rules to identify the cells from noise seems like it would be one of the best approaches, but when I load a properties file into CPA, it closes. Not sure if anyone might be able to provide some guidance there too.

I can’t attach the pipeline to this post, so here is a dropbox link to download it:

I have also attached the original cropped image (green) and then the image converted to grey and change in contrast using a log contrast transform from matlab.

Any help on revising the pipeline would be very much appreciated! Thanks so much!

Hi Stefan

Welcome to the forum.

You haven’t really given us any details regarding what you tried and what was inaccurate about it but this is the result that I got when I tried on the grayscale png.

The first thing I did was use CorrectIlluminationCalculate and Apply modules to calculate a background on your image and then divide the image by. This helped smooth out the tiling effects on your image. Also to avoid problems with the bright edge around your plate, I use Threshold on the illumination function and eroded it by 3 pixels to get a mask to apply to the image. This left with the image below.


The remaining step was a simple IdentiyPrimaryObjects which I’m sure you could adjust the parameters in to get more to your liking as I did it quite quickly. The output of module as outlines is shown on the grayscale png you attached is below and the pipeline is here forum_Pipeline.cppipe (16.6 KB)
Forum ,
If this is insufficient to you I think you probably need to explain what you’ve tried so far.

Good luck!


Hi Laura!

Thank you so much for your reply!

Could you walk me through a little more on how you worked through the illumination correction? That’s something I tried to get working a while back, and couldn’t properly get the illumination corrected, so have been trying to work around it. Thank you so much for providing the pipeline you made! I am just struggling for the logic behind the module settings.

One method I have found that works is preprocessing the images in matlab to create a log contrast transform. The basic pipeline I have now is: crop the wells manually in ImageJ, log contrast transform in matlab, noise reduction in CP3, then identify primary objects.

I now have a pretty decent working pipeline, but reducing the noise by making the stitching artifact less prominent during the preprocessing steps would be super helpful!

Also, do you have any recommendations for getting cell profiler analyst working? I can’t figure out how to create a working properties file, and am suspecting I am not setting up my export to database module correctly, and/or don’t have SQL Lite set up to work properly.

Thank you again for your help! I so appreciate it!

Hi Stefan,

No problem!

Regarding how I set up illumination correction, do you click the question marks to the right of each parameter when setting up your pipelines? I think that’s where I learned the most about CellProfiler and how the settings of the modules work. So if you read the pop up window for the third one where is explains Regular vs Background illumination calculation I hope you’ll agree we want Regular in this situation. By the way, an important thing in your image is that because you have a large number of pixels out side the well that are part of the image to CellProfiler but that we want to ignore.

In that same pop up window, it is explained that it makes no sense to do a Regular illumination correction on one image at a time without smoothing so from the basic parameters I think I just added the smoothing method (I let if pick the smoothing filter size automatically). I then ran the module and assessed the illumination image to check that it accurately looked like the background of you well. From below it’s clear that it’s capturing the effect of stitching and the darker and lighter zones of the image effectively. So this made me think it would probably do a good job of correcting the background thus making it possible to detect the objects.
Just as a note on your described method. Obviously great you’ve got something that works for you but you might want to look into RescaleIntensity in CellProfiler because I suspect you can get the same result as the MATLAB contrast adjustment and if so it would reduce your number of steps by one.

Re: CellProfiler Analyst, first, could you see if you can open the example Properties file at the bottom of this page to check your instance of CPA is working?

After that, I’ve added an ExportToDatabase to the pipeline I used above here: forum_Pipeline_CPA.cppipe (22.9 KB). When I ran it, I got a properties file that seemed to run completely fine in Analyst. I looked back at your pipeline and there were problems with what you had in that module. For example, you should probably setting it up as SQLite if you don’t have an SQL server which I’m assuming you don’t. Read more about why here

Good luck!