trim_nearby_peaks(peaks, dt, f=1.0)¶
Finds pairs of peaks that are nearer to each other than to the solid phase, and removes the peak that is closer to the solid.
peaks (ND-array) – A boolean image containing True values to mark peaks in the distance transform (
dt (ND-array) – The distance transform of the pore space for which the true peaks are sought.
f (scalar) – Controls how close peaks must be before they are considered near to each other. Sets of peaks are tagged as near if
d_neighbor < f * d_solid.
image – An array the same size as
peakscontaining a subset of the peaks in the original image.
- Return type
Each pair of peaks is considered simultaneously, so for a triplet of peaks each pair is considered. This ensures that only the single peak that is furthest from the solid is kept. No iteration is required.
 Gostick, J. “A versatile and efficient network extraction algorithm using marker-based watershed segmenation”. Physical Review E. (2017)