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/697b049d7b2418ec366c8fc493a9b1a510c952715fcfa6bd100142ffa13f4f16.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/87a053cca935128730e33dbe04a3f75e3c3ca93b9a90ec22165153bf8345fcb3.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/37345d09189417650a7303cd364d409edfa9f4f2f210a6ac0ae4bb4afb363e0d.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/4f61153ce1fc0566b16611762e17b91bff4da9e93394bccc62b5967281683122.png