PytorchBackend.center_of_mass#

PytorchBackend.center_of_mass(arr, cutoff=None)#

Computes the center of mass of a numpy ndarray instance using all available elements. For template matching it typically makes sense to only input positive densities.

Parameters:
arrBackendArray

Array to compute the center of mass of.

cutofffloat, optional

Densities less than or equal to cutoff are nullified for center of mass computation. By default considers all values.

Returns:
BackendArray

Center of mass with shape (arr.ndim).