get_planes#

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

Generate image for testing#

im = ps.generators.blobs([100, 100, 100], blobiness=[1, 2, 3])

fig, ax = plt.subplots(figsize=[4, 4]);
ax.imshow(im[50, ...])
ax.axis(False);
../../../_images/aed46dffbb79a9f20ee9cc2fea00d060dce51d2def365bd6e443e6b0d791ab64.png

Demonstrate function#

im1,im2,im3 = ps.tools.get_planes(im=im, squeeze=True)
fig, ax = plt.subplots(1, 3, figsize=[8, 4]);
ax[0].axis(False)
ax[0].imshow(im1)
ax[1].axis(False)
ax[1].imshow(im2)
ax[2].axis(False)
ax[2].imshow(im3);
../../../_images/54325c73dd5ccfcfa738815416a08b8934ccf20730a26235ccec3fb9d66865ff.png