show_planes#

Create a quick montage showing a 3D image in all three directions.

import matplotlib.pyplot as plt
import numpy as np
import porespy as ps
import inspect
ps.visualization.set_mpl_style()
inspect.signature(ps.visualization.show_planes)
<Signature (im, spacing=10)>

im#

The input image is 3D array to be veiwed in three directions. Note that the method does not work for 2D arrays as input. Note that the upper left image shows the xy plane at z=(image length in z dir/2). The lower left image shows the xz plane at y=(image length in y dir/2). The upper right image shows the yz plane at x=(image length in x dir/2).

im = ps.generators.blobs(shape=[40, 40, 40])
planes = ps.visualization.show_planes(im)
fig, ax = plt.subplots(1, 1, figsize=[8, 8])
ax.imshow(planes)
ax.axis(False);
../../../_images/5d2e9808ca1ff226ba99385a8d700666e42e861ae4277111cc191ad53ed036b2.svg

spacing#

This parameter defines the amount of space to put between each plane. The default spacing is 10.

planes = ps.visualization.show_planes(im, spacing = 2)
fig, ax = plt.subplots(1, 1, figsize=[8, 8])
ax.imshow(planes)
ax.axis(False);
../../../_images/b1a1815f7f7c43335c34d9c2e6393008fc0d762944a746de779726a8c20cf914.svg