insert_sphere

Import packages

[2]:
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

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

fig, ax = plt.subplots(figsize=[7, 7]);
ps.visualization.imshow(im);
plt.axis(False);

#default values:
c=[50,50,50]
r=50
v=False
overwrite=True
../../../_images/examples_tools_howtos_insert_sphere_4_0.png

Apply tool

[4]:
im = ps.tools.insert_sphere(im=im, c=c, r=r, v=v, overwrite=overwrite)
fig, ax = plt.subplots(figsize=[7, 7]);
ps.visualization.imshow(im);
plt.axis(False);
[4]:
(-0.5, 99.5, -0.5, 99.5)
../../../_images/examples_tools_howtos_insert_sphere_6_1.png