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()
[12:40:01] ERROR    PARDISO solver not installed, run `pip install pypardiso`. Otherwise,          _workspace.py:56
                    simulations will be slow. Apple M chips not supported.                                         

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/b077668f1266a218e5185f3919f6f31aea3e8ce2d47432a79e6c55d68f360d77.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/544c12f1efc2f4edd5c356fcee46515ad0baee27aa314de655fdc26d12e98bb2.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/f90ca75b432b2272c244a8a4661bcb752b02ad4293a0aac9be3dfb713476736a.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/11fabfa140348fb062546a66658fff1686c49734f3699f51d5f2114734fe9918.png