Cellprofiler relateobjects Area measurements


So I am running the relateobjects module on two of markers so that I can gauge overlap in areas and locations etc. Once I run that I run the measure area module and measure the markers separately as well as from the relate objects module. However what I am finding strange is that the area measured from the relateobjects module is larger than the area of the marker with the smaller area which doesn’t make sense since it means that there is more than the area of marker one being taken into account. It is still smaller than the area of marker 2 but if I understand the relateobjects module correctly, it should be only looking at overlap area between the two markers so the highest it should ever be is 100% of the smallest area marker.

Example: Marker 1 area: 1000, Marker 2 area: 5000, area measured from relateobjects of marker 1 and 2: 3000. So I feel like it shouldn’t be more than 1000 in this case.

Any insight on this would be appreciated.


Hi @Harristotle,

I’m not sure exactly what you’re trying to do with the RelateObjects module, it’s not strictly intended for calculating overlap. You might find the MeasureObjectOverlap module to be more useful for this task.

Which exact area measurement are you referencing here? As in, what’s the full column name that you’re getting “area measured from relateobjects” from? There’s an option to calculate the mean of measurements from child objects, so if an object has multiple children this could be different.

Hi @DStirling,

So essentially what I’ve been trying to do is just see the correlation in different cell line conditions between the two markers. I tried actually using the colocalization tool to measure the pearson correlation but I’m unsure if it is working properly or if I am using it correctly (I’m getting a lot of NaN for the measurements that I want to look at which I know doesn’t make sense because visually there is definitely overlap). So then the other way that I wanted to do it was to get a count of the overlap between the two markers using the relateobjects tool (how many of each marker are overlapping, using the identify objects as the inputs) and then I wanted to measure that area as well to see how much overlap area there is between the two markers. I just tried the measure object overlap module, thanks for that. It seems the output for it is more statistical which is good but I would also want a quantitative value (i.e. area of overlap) as well to see the trend and be able to plot it and so on.

So I’m not doing anything with the mean, all I am doing is taking the output from the relateobjects module, and then measuring the area of that output using the “Measure Image Area Occupied” module and measuring the area occupied by objects. But then I was also measuring the individual markers areas as well for both markers (also using measuring area occupied by objects). And that is where I was seeing the discrepancies I had mentioned in my original comment.


Would you be able to upload a copy of your pipeline, perhaps with an example image set?

Another approach to calculating overlap area might be to measure the area of one object set, use an ImageMath module to subtract the second object set and then measure the resulting set’s area.

Ah it’s fine I was able to get it working in the end, thanks for the replies and the help. I realized that the relate objects module won’t only take the overlap but all of both objects, so even if they touch a bit it will take the full objects of both and thus the areas will be higher than what I was expecting. So yes I ended up doing a mask on the objects I was looking for and measuring those areas within the relateobjects module. And I think the subtraction would also be another solution to this to get only the overlapping area. Thanks!