Masked object as input does not work (whereas it used to)

Hi all

I am looking for a solution to a problem that seems to reoccur in my CP analysis pipeline. I am trying to use “MeasureObjectIntensityDistribution” on my nuclei (ch0/DAPI). Instead of using the other channel image in which a significant amount of background occurs for the measurement, I’d like to measure only the spots in that channel, which I defined using IdentifyPrimaryObjects > MaskImage. However, when I choose the masked image as input, I am unable to get the measurement.

Example_pipeline.cpproj (1.7 MB)

Of note:

  • it used to work in previous pipelines and images, both using czi formats and tif.
  • I ran other analyses in the meantime, which worked great.
  • The pipeline I have constructed to show the issue here also contains the RadialObjectDistribution modules on channel images, which also work great.

Thanks so much for looking into this!


Example_image.tif (7.5 MB)

Here is the example image.

Hello Carmen,
What is happening here is that your masked image (from spots objects) has many 0 intensity pixels inside the Nuclei object.
The module does work properly as you can see in your 3rd and 4th MesureObjectIntensityDistribution modules in your pipeline.
If you want to measure intensity distribution of smaller objects, you could use the nuclei as a mask and then use that masked image with the small objects.

Hi Nasim

Thank you for your prompt reply. I would however need to only look at the spots, excluding the background signal within the nuclei. It seems from your suggestion I’d still take into account the background in channel 1 and 2 surrounding the spots. Do you have a way to deal with this or is it just not possible?


For this you could use the Nuclei objects in ch0 image.

Could you elaborate on this? Do you mean you want the intensity distribution of these small spots in ch0?

Hi Nasim

The principle of what I would like to do is illustrated in the attached image. The goal would be to obtain an intensity, pertaining only to the spots, for each radial ring with the nucleus. Does this clarify the matter?


Thank you for the nice illustration.

So, it seems you want intensities of spots relative to the center or edge of the nuclei, correct?

MeasureObjectIntensityDistribution module, measures the spatial distribution of intensities within each object.

You could try RelateObjects module to relate the spots to nuclei), which can provide distance from the centroid of the child objects (spots objects) to the centroid of the parent (nuclei). Then use MeasureObjectIntensity for the spots to measure their intensities. If you want the distribution of intensity in the nuclei, you could use the MeasureObjectIntensityDistribution for the nuclei.

@bcimini may have a better idea.


I can confirm that the display for the two masked sets (compared to the non-masked) is weird, but it seems to just be a display issue- when I put an “ExportToSpreadsheet” at the end of your pipeline, the values themselves seem to be reported just fine. I think it’s likely just because your spots are rare, which means some of the nuclei have no unmasked pixels in them, which means the fraction of the intensity at any bin is 0/0, which throws an error (nan, or “not a number”)- if you look in the display, the COV is present, you can display it, and when you look at the sheet all the results are actually written for nuclei that do have spots in them. For reasons I haven’t yet determined, the COV comes out as 0 rather than NaN, which is why the display works- the reason the display DOESN’T work for FractAtD and MeanFraction are that when the value of any one nucleus is NotANumber, the average of the good values and NotANumber is still NotANumber, messing up the averages in the table, and the bad values also throw off the scaling in the picture.

I have reported the issue here, thanks for letting us know and sorry for the confusion!