measure_AreaOccupierd per Cell

I detected objects within cells. Now I want to calculate the ratio between the occupied area (object) and the occupied area (cell) on a per cell basis.
The problem so far is, that I can either use the ImageAreaOccupied or the AreaShape[1] function, but both do not work.

this gives me the area that shows intensity for a whole image. I need the area(intensity) per cell.

Here I wanted to compare the AreaShape feature 1 (=area) from the objects and the cell. The problem occurs, because I have multiple objects per cell.
My workaround: I unified the objects within the cell.
Drawback: I cannot tell CP to unify all “children” of a cell. I can only unify everything in a certain distance, which does not work most of the time.

Is there a way to incorporate “Unify all children” in the Unify module?
Would there be another way to work around this?

Hi Skadi,

Is it possible to work this problem from the other direction? I.e, try the following:
(1) Identify the objects with IdentifyPrimary
(2) Identify the parts of the cell with IdentifySecondary
(3) Next, you would merge adjacent parts of the same cell into complete cells with UnifyObjects. I think the default options to UnifyObject (Distance = 0; Grayscale image = None) should be fine.

Of course, this only succeeds if your cells are not touching. Let us know if this works.

I think that will not work, because some cells will touch each other, but I can try.
Would it be possible to get the option unify_per_cell in the Unify-module of future versions?


I see no reason why that can’t be possible, or straightforward to do. I’ll add that to our list of features to add for upcoming releases.



I was looking over this post just today and just realized another workaround to this problem:

  • ConvertObjectsToImage: Convert your subobjects to a binary image

  • MeasureObjectIntensity: Measure using the cell objects against the binary image

The IntegratedIntensity measure will effectively give you the number of foreground sub-object pixels on a per-cell basis, which is essentially the area of the sub-objects.