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/51120ed25ce488d747c6fc4657de17258fb0e5e1783bedb4a1b5bd0e575c0da8.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/3c2dbbab07ebe45c5898ab63ed332a78fdc09b538d704681109781e9a330ba23.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/bc97267d30b2eeeb25d63d145b8527ad1d3cc3f7f9f7fc541326be4f23d79451.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/1cfc04d1efaee384c1717ceb953a7e8e13b82863a1af71ed5e2d96132ff760db.png