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 porespy as ps
import matplotlib.pyplot as plt
import numpy as np
import inspect

The arguments and default values of the function can be found as follows:

inspect.signature(ps.generators.faces)
<Signature (shape, inlet=None, outlet=None)>

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/b65626e9c3409f460be68e2451c55ee9cec2b71fdba02644334b29ee6616f1bf.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/19f7e812aa6dbe23ef64e6ff7f29b3639ec92e15a8e779e0b01368752dda7890.png