Does "Relate" assigns same indices to related objects?



I have 2 categories of objects (let’s say cells and nuclei) which were identified using separate IdentifyPrimAutomatic modules.
Each nucleus object is embbeded within a cell object, so I use the Relate module to associate each nucleus-cell couple.
The cell objects were not necessarily identify in the same order as the nuclei objects since they were identified separately.

In this case, there are as many parent objects as there are children objects, so I assumed that the Relate process would have assigned the same indices to each related objects, but it does not seem to be the case…
For example, let’s say nucleus #3 was the third to be identified. The Relate module has associated nucleus #3 to cell #2 because nucleus #3 is embbeded within cell #2, however it seems that the Relate module has not changed the label of nucleus #3 to #2… It is a problem if I want to make calculations with the measurements of the associated cells-nuclei objects. Let’s say I want to calculate, using the CalculateMath module, the ratio of the area of each nucleus to the area of its associated cell, then the calculation will be erroneous since the associated nuclei and cells are not in same order (they don’t have the same indices).

Is there a way to assign the same indices to related objects (other than using IdentifyPrimAutomatic followed by IdentifySecondary)?

Thanks for the answer,


Error while cycling through images

Hi Vincent,

I’m guessing what you’re trying to do is create two primary objects (Cells and Nuclei), measure Area (or some feature), and take the ratio of these two for each objects. Yes, the easiest and most robust way is to simply make nuclei your primary object and cells your secondary object- that way in your final measurements, each object only has one instance (rather than having two sets of objects with identical indices-which is what you’re asking to do). What relate does is add a measurement to the child object: Parent_Cells, which gives the index of the Parent object for each cell. When you measure things (area etc) about nuclei and Cells in previous modules, all you are measuring is the individual cells and nuclei as primary, distinct objects, and relate just tells you which nuclei are inside which cells.

You can calculate ‘Mean’ measurements for children- such as what is the mean nuclear area in my cell, for example. Theoretically, this measurement (Mean_Nuclei_AreaShape_Area, stored actually as a measurement under ‘Cells’ rather than Nuclei) could be accessed by CalculateMath, as you suggest. However, as it stands, ‘Mean’ measurements are not accessible via the subfunction which calls the features for ‘math’ modules (CalcMath,CalcStats etc). It’s a simple fix I could direct you to if you absolutely need it and you are using the developer’s version and are comfortable editing the code. However, if you are using the compiled version, this is not fixable.

The idea behind relate is to relate multiple child subobjects to parents- like speckles inside a nucleus, for example; in this case, Mean measurements are somewhat more meaningful. In your example (Nuclei to Cell), generally a Cell only has one Nuclei, so the “mean” is the same as the actual nuclei measurement. In this case, Using IDPrim and IDSecondary seems to make the most sense. If the example you provided is not accurate, and you really are dealing with a case of many subojects, where accessing the Mean measurement may be very useful, please provide more details so we know if this is a higher priority than we perceive it to be.


Hi Kate,

Thanks a lot for the quick answer.
I am using the compiled version because I don’t have access to the Image Analysis toolbox…
From what you said, I understand that the most logical way to do what I want to do is to use IdentifyPrimAutomatic followed by IdentifySecondary. That’s fine, I will do that.

Thanks again,