Masking or Filtering objects using 2 parents

Sample image and/or code

Hi, I am identifying several objects:

  • Nuclei (only those not touching border),
  • MicroNuclei,
  • Periphery (Tertiary Object from Expanded and ShrunkenNuclei)
  • Telomeres

I relate Telomeres to Nuclei and Micronuclei and Periphery successively (to get counts/parent mainly), and I measure intensities etc for all objects.

I would like to exclude from the analysis Telomeres that are NOT in Nuclei AND NOT in MicroNuclei.
(those that are in Nuclei touching the border)

This should be an easy one but I can’t get a combo to work (FilterObject only works on 1 object, not multiple ones … though would be neat :wink: )
Is tehre a means to filter Objects and their children that are touching the border ie remove nuclei object that touch the border and their respective children?

Any idea how to achieve this?


PS Using CP 4.0.6

This feels like a bit of round about way of doing this but my initial thoughts are

  • One IdentifyPrimaryObjects module to capture all nuclei (including those touching edges) - “NucleiAll”

  • One IdentifyPrimaryObjects module for the nuclei you want - “Nuclei”

  • Use MaskObjects with “NucleiAll” and “Nuclei” to leave you with edge touching nuclei - “EdgeNuclei”

  • Use MaskObjects with your Telomere objects and the “EdgeNuclei” to leave you with telomeres not in nuclei touching the edge.

Thinking about this more as I’ve thought it would be good to have AND/OR expressions etc in FilterObjects since this would help you (if you could say a minimum measurement of 1 of nuclei parent OR micronuclei parent).

However, it made me realise something, you can filter the “Orphan Telomeres” (by setting FilterObjects to limit the Telomeres to those with maximum 0 parent nuclei and 0 parent micronuclei). Once you have those orphans then can be used MaskObjects to leave you with Telomeres that have at least one parent.

oh this sounds like a good approach! Thanks!!
I’ll give it a quick try when the little one is finally in bed!
will keep posted


1 Like

If I’m understanding this correctly, another approach might be to use 2 FilterObjects modules to grab each set of telomeres, then use CombineObjects to merge the sets together?

Oh wow, while I was considering it I was thinking it would be useful to be able to combine objects. Is that a 4.0 module? I’ve clearly not been keeping up with latest developments.

Yup, CombineObjects was added in 4.0. Thinking about it, it might be necessary to re-run RelateObjects after merging so as to associate the combined telomere set with the correct parents, so masking off the unwanted areas before doing the initial segmentation might still be the most effective approach here.

1 Like

Hi guys,

thanks very much for this! After detecting both Nuclei and Micronuclei I thus did:

  1. CombineObjects: Nuclei and MN (microNuclei) just to use as a mask

  2. use that to mask image of telomeres prior to detection

  3. relate detected Telomeres to Nuclei or MN

  4. do the different measurements on each set (Nuclei, MN; )

seems to have worked!! (though now I have to see how to have all objects measruements within one CSV…
Will keep you posted if errors or other auestions related to this



1 Like