imshow#

This is a wrapper around matplotlib’s imshow that works better with voxel images

import porespy as ps
import matplotlib.pyplot as plt
ps.visualization.set_mpl_style()

im#

The image to show. Can be 2D or 3D:

im = ps.generators.blobs([100, 100, 100], blobiness=[1, 2, 3])
ps.visualization.imshow(im);
../../../_images/afa83b8fcc6ad8b03c73299e2288161a8e3f9c7259fb8b494a3c74233468db51.svg

axis#

3D images must be sliced to present a 2D view. This argument controls which axis to slice along. The default is 2, which is the traditional z-axis, so the function will show an xy slice.

ps.visualization.imshow(im, axis=1);
../../../_images/2e6fe966689fe3d54a744198c30c398d5b7e122beb97ee77a37b4e2578948764.svg

ind#

The location or index to slice at, with the default being the midpoint of the specified axis.

ps.visualization.imshow(im, axis=1, ind=10);
../../../_images/fdc7ea50e6ae29182631c50834ea72a3f306adac044d87844b1f6c9afe7a83a1.svg

kwargs#

All other keyword arguments are passed on to plt.imshow. For instance you can set the colormap:

ps.visualization.imshow(im, axis=1, ind=10, cmap=plt.cm.plasma);
../../../_images/4d9898ef005ab103bf6b157a27081c94903e1fe9166eab2961dbe7ab7ef605d7.svg