Tertiary object issues - CellProfiler 4.0.4

Dear @CellProfilerTeam,

I’m trying to use CellProfiler, to generate bands around nuclei, but I would need that this band are limited to the cell body (eg the band can not be out of the cell), and I have this two channels:

So far, I detected the nuclei (on channel 2), expanded the nuclei, created a Secondary using the nuclei and the red channel (cell). From these objects I created Tertiary objects, using either “cell and nuclei” or “cell and expand nuclei”. When I combine the 2 newly created object I have an unexpected results, some weirds outlines remaining, cf image below :

I thought a workaround would be to shrunk it , but it doesn’t work as I would expect:

I wonder :

  • if my approach is over-complicating things (eg maybe there is a module that does extactly this but I didn’t find it yet)
  • if what I get with the tertiary operation is expected or is it a bug ?

Please find here a zip file with the pipeline and some test images.

Thank you for your help,


Hi @romainGuiet,

It looks like this is happening because in the final IdentifyTertiaryObjects module the smaller objects aren’t completely enclosed by the larger objects. IdentifyTertiaryObjects will usually mask the smaller object by 1 pixel to ensure that the whole object isn’t removed if the larger object is exactly the same size. In this case it produces the extra outline in the non-overlapping areas.

You should be able to fix this by disabling the “Shrink the smaller object prior to subtraction” option in the module settings.

1 Like

Thank you @DStirling !
Silly me :sweat_smile: I totally forgot about this shrink object option ! :hugs:
Thank you for you swift help!