show_3D#

Rotates a 3D image and creates an angled view for a rough 2D visualization. This method uses scipy.ndimage.rotate function to view the 3D image from an angle, then projects the result in 2D. This method is useful for a quick visualization of small prototype images. Because it rotates the image it can be slow for large images.

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_3D)
<Signature (im)>

im#

The input image is 3D array to be veiwed in 3D. Note that the method does not work for 2D arrays as input.

im = ps.generators.blobs(shape=[40, 40, 40])
im_viz = ps.visualization.show_3D(im)
fig, ax = plt.subplots(1, 1, figsize=[12, 5])
ax.imshow(im_viz)
ax.axis(False);
../../../_images/9c2602b84465e3e2a3ecf4f609253a1bfef706b6379895bbc8f53592220f25b6.svg