visualization¶

Create Basic Views

This module contains functions for quickly visualizing 3D images in 2D views.

 porespy.visualization.sem(im[, direction]) Simulates an SEM photograph looking into the porous material in the specified direction. porespy.visualization.xray(im[, direction]) Simulates an X-ray radiograph looking through the porouls material in the specfied direction. porespy.visualization.show_3D(im) Rotates a 3D image and creates an angled view for rough 2D visualization. porespy.visualization.set_mpl_style() porespy.visualization.show_mesh(mesh) Visualizes the mesh of a region as obtained by get_mesh function in the metrics submodule.
porespy.visualization.sem(im, direction='X')[source]

Simulates an SEM photograph looking into the porous material in the specified direction. Features are colored according to their depth into the image, so darker features are further away.

Parameters: im (array_like) – ND-image of the porous material with the solid phase marked as 1 or True direction (string) – Specify the axis along which the camera will point. Options are ‘X’, ‘Y’, and ‘Z’. image – A 2D greyscale image suitable for use in matplotlib’s imshow function. 2D-array
porespy.visualization.xray(im, direction='X')[source]

Simulates an X-ray radiograph looking through the porouls material in the specfied direction. The resulting image is colored according to the amount of attenuation an X-ray would experience, so regions with more solid will appear darker.

Parameters: im (array_like) – ND-image of the porous material with the solid phase marked as 1 or True direction (string) – Specify the axis along which the camera will point. Options are ‘X’, ‘Y’, and ‘Z’. image – A 2D greyscale image suitable for use in matplotlib’s imshow function. 2D-array
porespy.visualization.show_3D(im)[source]

Rotates a 3D image and creates an angled view for rough 2D visualization.

Because it rotates the image it can be slow for large image, so is mostly meant for rough checking of small prototype images.

Parameters: im (3D-array) – The 3D array to be viewed from an angle image – A 2D veiw of the given 3D image 2D-array

Notes

This function assumes that the image contains True for void space and so inverts the image to show the solid material.

porespy.visualization.set_mpl_style()[source]
porespy.visualization.show_mesh(mesh)[source]

Visualizes the mesh of a region as obtained by get_mesh function in the metrics submodule.

Parameters: mesh (tuple) – A mesh returned by skimage.measure.marching_cubes fig – A handle to a matplotlib 3D axis Matplotlib figure