Cell count with grid


I’m trying to use cellprofiler to take the original blood cell image -

, crop and rotate to only look at the area in the black rectangle of the top image, and then count the cells. The first image should return 17 cells which is the manual count, but as the cell images arent hugely distinguishable it’s having trouble identifying them and also seems to be incorrectly confusing parts of the grid as cells (as they are a similar colour).

Can anyone advise how I can alter the pipeline so that it only looks for spherical objects and ignores the gridlines? Any help would be hugely appreciated, attached is my pipeline attempt attempt.cp (8.55 KB)


Give the attached pipeline a try. It does some extra pre-processing to the images:
(1) Uses a ‘bottomhat’ filter to take the original (non-inverted) image and highlight dark, circular regions.
(2) A ‘close’ operator attempts to fill in and connect some regions properly.

Other notes:

  • InvertForPrinting is not recommended (it does some other image scaling that is not necessarily apparent nor desired unless printing). Use ImageMath->Invert instead (or use Morph-> bottomhat and get inverting for free!)
  • Probably a minor difference, but I moved the ColorToGray to the beginning of the pipeline so as to minimize CP carrying around big color images down the pipeline. If you only need a single color channel (grayscale), then either try and not image it, or minimize the memory needed by using ColorToGray as soon as possible.
  • Avoid JPG if possible! FAQ entry

Good luck!
attempt_DLogan.cp (9.11 KB)

David - thank you so much for your help with this, hugely appreciated!!! Its a credit to the software and the people on the forum that experienced users are so willing to help others, thank you!!!

Glad I could help! I am on the CP team and we are happy to help in our limited “free” time. Remember us when it comes time to publish! How to cite CP