imshow#

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

import matplotlib.pyplot as plt

import porespy as ps

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/8f1e23422c8ff7f74693f75d562a9da285a5582c4e60bd36a1d563db3c2d081a.png

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/8130ce723fd906458aff5e4b403a5e51646aef9626845aeb12cd067ea0c417f7.png

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/934492a425a7736969ad07555293b36970e305729ad71781c8e76c1f5b67e8a2.png

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/4a978cab728b531ae856a4234f5e76eff122794c9503c820feb387411fd6e0af.png