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

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

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