hold_peaks

Import packages

[1]:
import numpy as np
import porespy as ps
import scipy.ndimage as spim
import matplotlib.pyplot as plt
import skimage
ps.visualization.set_mpl_style()

Create image and variables

[2]:
im = ps.generators.blobs(shape=[500, 500])
im = im.astype(np.float32)
plt.figure(figsize=[7,7])
plt.axis(False)
plt.imshow(im)

#default values:
axis=-1
../../../_images/examples_filters_howtos_hold_peaks_4_0.png

Apply filter function

[3]:
x = ps.filters.hold_peaks(im=im, axis=axis)
xx = ps.filters.hold_peaks(im=im, axis=0)

fig, ax = plt.subplots(1, 2, figsize=[15, 15]);
ax[0].imshow(x);
ax[1].imshow(xx);
ax[0].axis(False)
ax[1].axis(False)
ax[0].set_title('axis = -1')
ax[1].set_title('axis = 0');
[3]:
Text(0.5, 1.0, 'axis = 0')
../../../_images/examples_filters_howtos_hold_peaks_6_1.png