insert_cylinder

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()

Generate image for testing

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

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

Demonstrate tool

[21]:
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);
../../../_images/examples_tools_howtos_insert_cylinder_6_0.svg
[ ]: