subdivide
¶
Import packages¶
import numpy as np
import porespy as ps
import scipy.ndimage as spim
import matplotlib.pyplot as plt
import skimage
np.random.rand(0)
ps.visualization.set_mpl_style()
[01:03:38] 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¶
Apply tool¶
slice
objects are returned:
slices = ps.tools.subdivide(im=im, divs=2, overlap=20)
print(slices)
[(slice(0, np.int64(270), None), slice(0, np.int64(270), None)), (slice(0, np.int64(270), None), slice(np.int64(230), np.int64(500), None)), (slice(np.int64(230), np.int64(500), None), slice(0, np.int64(270), None)), (slice(np.int64(230), np.int64(500), None), slice(np.int64(230), np.int64(500), None))]