Count speckle area on cropped images


I am using CellProfiler to analyse black speckles on cropped regions of brightfield colour images. I manage to put together a pipeline to count the area of the cropped image, and the area of the black speckles within this cropped image. I am experiencing several problems:

  1. threshold out of 0-1 range in PrimAutomatic module: will this affect my results?
  2. PrimManual seems to display the stretched image by default, even if I select raw image subsequently.
  3. Calculations: I would like to divide the areas of the dots by the area of the cropped object. is there such a module within CellProfiler?
  4. Units of area: my cropped images are all of different sizes, but are analysed using the same pipeline: are their original dimensions retained? I would like to make comparisons across the cropped images, so it is crucial that they have not been scaled differently.
  5. When the cropped object is small, CellProfiler identifies the edges of the image as the black speckles (which appear white, because I have converted the image to grayscale and inverted it) even when there are really no dots at the edges, and when I have chosen to discard objects which touch the border of the image in the identifyPrimAutomatic module.

I have attached my pipelines for your reference: one crops the images and calculate area of the cropped image, the other analyses the speckles. I split it into two to reduce the time I have to spend in front of the computer to wait for CellProfiler to analyse the images after each one is cropped. If you know how I can crop multiple images all at once, and then do the subsequent analysis all on CellProfiler, I would be very happy to hear your suggestion!

Thanks very much for your help! I think CellProfiler is an amazing program. : )

countspeckleareaPIPE.mat (1.23 KB)

CropimagesPIPE.mat (1.04 KB)


Attached is a pipeline which does what I think you’re asking for.

In response to your questions:

  1. The threshold is not out of range, but the image is (I think because the area outside of the cropped region, when it gets inverted is above one? or at least at 1.0) I’ve changed this in my pipeline, so it doesn’t happen anymore.
  2. Selecting ‘Raw’ seems to work for me.
  3. I added a ‘CalculateMath’ module which does just this. I convert both the crop region of interest and the dots to images, so you can divide the full area of the dots by the full area of the cropping region.
  4. Yes, especially using the method mentioned in my answer to #3, the ratios should scale with image size.

countspeckleareaPIPE.mat (1.67 KB)

Hi Kate,

Thanks very much for your prompt help! it’s working very well now; I just had to adjust the threshold level of IdentifyPrimAutomatic for the dots to reduce artefacts (I replaced Otsu Global with a numerical number instead). Thanks! :smiley: