hold_peaks#
- hold_peaks(im, axis=-1, ascending=True)[source]#
Replaces each voxel with the highest value along the given axis.
- Parameters:
im (ndarray) – A greyscale image whose peaks are to be found.
axis (int) – The axis along which the operation is to be applied.
ascending (bool) – If
True
(default) the givenaxis
is scanned from 0 to end. IfFalse
, it is scanned in reverse order from end to 0.
- Returns:
result – A copy of
im
with each voxel is replaced with the highest value along the given axis.- Return type:
ndarray
Notes
“im” must be a greyscale image. In case a Boolean image is fed into this method, it will be converted to float values [0.0,1.0] before proceeding.
Examples
Click here to view online example.