reduce_peaks

reduce_peaks(peaks)[source]

Any peaks that are broad or elongated are replaced with a single voxel that is located at the center of mass of the original voxels.

Parameters

peaks (ndarray) – An image containing True values indicating peaks in the distance transform

Returns

image – An array with the same number of isolated peaks as the original image, but fewer total True voxels.

Return type

ndarray

Notes

The center of mass of a group of voxels is used as the new single voxel, so if the group has an odd shape (like a horse shoe), the new voxel may not lie on top of the original set.