hold_peaks¶
- hold_peaks(im: ndarray[Any, dtype[_ScalarType_co]], axis: int = -1, ascending: bool = 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 given axis is scanned from 0 to end. If False, 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.