faces#

A quick way to generate an image with 2 opposing faces set to True, which is used throughout PoreSpy to indicate inlets and outlets

import inspect

import matplotlib.pyplot as plt

import porespy as ps

shape#

This would be the same shape as the actual image under study. Let’s say we have an image of blobs:

im = ps.generators.blobs(shape=[10, 10, 10])
faces = ps.generators.faces(shape=im.shape, inlet=0, outlet=0)

ax = plt.figure().add_subplot(projection="3d")
ax.voxels(faces, edgecolor="k", linewidth=0.25);
../../../_images/b98de5eb2a78f317ffa34ce260760b19ccfd9b85483dc26c022a4a23be3b0764.png

inlet and outlet#

These indicate which axis the True values should be placed, with inlets placed at the start of the axis, and outlets placed at the end:

faces = ps.generators.faces(shape=im.shape, inlet=2, outlet=0)

ax = plt.figure().add_subplot(projection="3d")
ax.voxels(faces, edgecolor="k", linewidth=0.25);
../../../_images/1ded28f7b8c2838b7f4698d4b5529bcc67c32402412125bb949529800aeb431e.png