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/05fa1b2e421ce2408f5daf4734948b04e4a37e67c5276d387e4f17ffef573d66.svg

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/9eda7098da0206dbe13e97a63e84ba4062334e400761445025a3f04dd4d78481.svg