insert_sphere#

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

Create image and variables#

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/5f72b84b37480f423e38824bd83bfa8fd0cdd8cbd760bc0bb5d3ec2372d8c4d2.png

Apply tool#

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);
../../../_images/e79ed9993c469ddaa112740866c93b5714e0dadf3d2d8600cd9067b4984b9643.png