Import packages#

import numpy as np
import porespy as ps
import scipy.ndimage as spim
import matplotlib.pyplot as plt
import skimage

/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/openpnm/algorithms/ NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See for details.
  def _find_trapped_pores(inv_seq, indices, indptr, outlets):  # pragma: no cover

Generate image for testing#

im = ps.generators.blobs([100, 100, 100])

fig, ax = plt.subplots(figsize=[4, 4]);
ax.imshow(im[..., 50]);

Demonstrate tool#

im =*1.0, xyz0=[20, 20, 20], xyz1=[60, 60, 50], r=20)

fig, ax = plt.subplots(figsize=[4, 4]);
ax.imshow(ps.visualization.xray(~(im > 1)));