find_peaks(dt, r_max=4, strel=None, divs=1)¶
Finds local maxima in the distance transform
dt (ND-array) – The distance transform of the pore space. This may be calculated and filtered using any means desired.
r_max (scalar) – The size of the structuring element used in the maximum filter. This controls the localness of any maxima. The default is 4 voxels.
strel (ND-array) – Specifies the shape of the structuring element used to define the neighborhood when looking for peaks. If
None(the default) is specified then a spherical shape is used (or circular in 2D).
divs (int or array_like) – The number of times to divide the image for parallel processing. If
1then parallel processing does not occur.
2is equivalent to
[2, 2, 2]for a 3D image. The number of cores used is specified in
porespy.settings.ncoresand defaults to all cores.
image – An array of booleans with
Truevalues at the location of any local maxima.
- Return type
It is also possible ot the
peak_local_maxfunction from the
skimage.featuremodule as follows:
peaks = peak_local_max(image=dt, min_distance=r, exclude_border=0, indices=False)
The skimage function automatically uses a square structuring element which is significantly faster than using a circular or spherical element.