Problems with numbering of objects

I just realized that the modules identifysecondaryobjects and identifytertiaryobjects do not always preserve the object labels, i.e., if a primary object (e.g., a nucleus) has a label of 10, then the corresponding secondary and tertiary objects (say, cytoplasm) are not guaranteed to also have a label of 10. The worst part is that most of the time, the labels are the same, so it took me a while to discover this issue.

Our downstream processing expects the nucleus and cytoplasm from a cell to have the same label. Fixing this will be rather obnoxious; the reassignobjectnumbers module can’t do it, and I don’t want to mess with the relatejobects module.

I can’t think of a situation in which a person would not want corresponding primary, secondary, and tertiary objects to have the same label. Why not enable this? Just disable “discard secondary objects touching…”, and whatever else is necessary to ensure that every primary object has exactly one secondary object.

Hi,

This seems like unexpected behavior as well. Could you upload a pipeline and sample image where this behavior occurs?

Regards,
-Mark

[quote=“mbray”]Hi,

This seems like unexpected behavior as well. Could you upload a pipeline and sample image where this behavior occurs?

Regards,
-Mark[/quote]

Ok, I figured out the problem, and it was my fault. The labels are getting changed during a morph operation, since I have to use identifyprimaryobjects to get the opened objects back.

Is there any way to smooth the borders of objects in such a way that will preserve the labels?

This does bring up the issue of what CP does in identifytertiaryobjects, if corresponding larger and smaller objects don’t have the same label: the tertiary objects are assigned the label of the larger object, which makes sense.

Could you use ExpandOrShrinkObjects, once to shrink (erode), then again to expand (dilate)?

I’m inclined to say that it should be an error, since there is an implicit assumption that the relationship between primary: secondary: tertiary objects is 1:1:1.

Then again, if you are looking some something more generic, you could try MaskObjects which masks one set of objects with another, regardless of how the objects are related.

Regards,
-Mark