insert_cylinder

Import packages

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()
[01:03:09] ERROR    PARDISO solver not installed, run `pip install pypardiso`. Otherwise,          _workspace.py:56
                    simulations will be slow. Apple M chips not supported.                                         

Generate image for testing

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

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

Demonstrate tool

im = ps.tools.insert_cylinder(im=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)));
plt.axis(False);