Pixel intensity Distribution problems


I have a set of Brain images (DAB imunohistochemistry for nuclei staining) at “10X magnification”. they vary a lot in their pixel intensity distribution. I’m trying to come up with a pipeline that can be adaptative to this variation and still have the same standard for nuclei counting. But not totally successful.
My pipeline is as follows (and shared):

  • CorrectIllumminationCalculate (regular, re-scaling and Gaussian smoothing) - the Gaussian improved this a lot, but still not enough
  • Morph (inverse the orginal image)
  • CorrectIllumminationApply (divide, apply the correction function in the inverse image)
  • Enhance&Suppress Features (Enhance speckles)
  • IdentifyPrimaryObjects

However, while for some images I have a result pretty near the ideal, for others there are too many false positive. If I try to make the threshold more stringent for the latter one, the former will not count too many true positives.
I filtered out some false positives based on shape,size with MeasureObjectSizeShape and FilterObjects. But still not enough.
I was trying to filter using measureObjectIntensity, or measureObjectRadialDistribution, but any parameter I’d put in both that would serve for the image that needs filtering would make the “close-to-good” images filter out a lot of true positives again. I am currently not able to find a module that would adapt the filter to the image pixel intensity distribution (which I think would get me closer to ideal) or find a module that would be conditional enough to apply different thresholds to images according to their pixel intensity distribution.
Also, I tried resolve this in the pre-processing, correcting illumination or anything, but none would equalize their distribution and allow for one single threshold value for all. The Enhance&Suppress Features does that a lot, but the images (as you can see below), have a difference in background that just make their pixel distribution a lot different.

Is there a way to account for that kind of difference in one single pipeline? Either in pre-processing the images or in filtering out objects?

I appreciate any help,

Cesar Coelho
cell_proj.cpproj (563 KB)


I was able to correct the background in a very good very (apparently) by making a ‘regular’ illumination correction across all imgs and divide by img, AND THEN getting the remaining variation with an additional background illumination correction for each img, subtracting it from the img. I saw it in a previous Topic and tried on my images. But in that Topic, the second background correction was across all imgs too, which confused me if it should be in the first cycle or across all cycles (requiring me to run it in a second pipeline in either way). Doing it for each img worked well for my imgs, BUT:
1 - Is this (Background Illum correction, for each img) an OK thing to do?
2 - Is it OK to use smoothing (Gaussian) in both corrections?

3 - I realized I’m running in a second problem (Please tell me if I should put it in a new Topic). My IDPrimaryObj is inconsistent, not counting some well stained nuclei and counting some others with a fairly low intensity (there is a degree of staining to which the cell is to be counted). At first, I thought it would be because of the background subtraction that would render these cells less intense and not count them. But comparing the corrected images with the original that seemed not be the problem, since intensely stained nuclei were more bright in the processed imgs.
My IDPrimaryObj is set as follows:

Global Threshold (I tried adaptive, they are really similar after the correction)
Background Method (correction factor of 3)
Method to distinguished clumped Objs: Intensity
Method to draw line : Intensity

I know that the correction factor may seem really stringent, but for the background method it seemed to work OK, although some really poorly stained nuclei are still counted.
Is there any alternative to be more consistent? I mean maybe be more flexible in the IDPrimaryObj and try to filter low stained nuclei out, maybe?
I’m trying the other methods of thresholding, but they seem to have the same output in this.

Any other advice would help a lot,

Thanks in advance,

Hi Cesar,

I think my response to your other recent post here should cover the questions in this similar thread, too.