 # Mass Displacement

Could anybody explain the calculation of the Mass Displacement? We did not get it from the help How is the center of gravity determined? What do you mean with grayscale vs. binary?
In which cases does it show big values? In which cases do you get small ones?

We have an idea of what it could be, but no clue how it is calculated and if our assumption is correct at all…

Hi,

From the Help:

The python source code is here (search for displacement; near line 392): github.com/CellProfiler/CellPro … tensity.py

[quote] # The mass displacement is the distance between the center
# of mass of the binary image and of the intensity image. The
# center of mass is the average X or Y for the binary image
# and the sum of X or Y * intensity / integrated intensity[/quote]

But in simpler terms, the mass displacement is calculated by taking a weighted average of the pixels in both X and Y. For a binary image (all ones and zeros), the weights are all ones. So the center-of-mass works out to be simply the average X and Y locations of the object’s pixels. But for a grayscale, intensity varying object, each pixel is weighted by its intensity, so that brighter pixels carry more weight when averaging.

So imagine 2 circles, one with even brightness across the circle (possibly even binary, i.e. ones for intensity values), and one that is bright on one side and dimmer on the other. Now, it could be gently varying in brightness from one side to the other (i.e. grayscale), or it could be very bright on one side (e.g. 0.99) and very dim, but even across the other side (e.g. 0.01), but the result of the mass displacement is qualitatively similar. The center-of-mass of the binary circle is the exact center of the circle. For the other, unevenly bright circle, the center-of-mass will be shifted to the side of the brighter pixels. The distance between the center of the circle and the shifted center-of-mass is the mass displacement. For the exact calculation, please consult the code.

Does that help?
David

1 Like