region_size

Import packages

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

ps.visualization.set_mpl_style()
np.random.seed(10)

Genearate image for testing

[2]:
im = ps.generators.blobs(shape=[100, 100])
fig, ax = plt.subplots()
ax.imshow(im, origin="lower");
../../../_images/examples_filters_howtos_region_size_4_0.svg

Apply filter function

[3]:
x = ps.filters.region_size(im=im)
fig, ax = plt.subplots()
ax.imshow(x, origin="lower");
../../../_images/examples_filters_howtos_region_size_6_0.svg