generate_voxel_image(network, pore_shape='sphere', throat_shape='cylinder', max_dim=None, rtol=0.1)[source]

Generate a voxel image from an OpenPNM network object

  • network (OpenPNM GenericNetwork) – Network from which voxel image is to be generated

  • pore_shape (str) – Shape of pores in the network, valid choices are “sphere”, “cube”

  • throat_shape (str) – Shape of throats in the network, valid choices are “cylinder”, “cuboid”

  • max_dim (int) – Number of voxels in the largest dimension of the network

  • rtol (float) – Stopping criteria for finding the smallest voxel image such that further increasing the number of voxels in each dimension by 25% would improve the predicted porosity of the image by less that rtol


im – Voxelated image corresponding to the given pore network model

Return type:



(1) The generated voxelated image is labeled with 0s, 1s and 2s signifying solid phase, pores, and throats respectively.

(2) If max_dim is not provided, the method calculates it such that the further increasing it doesn’t change porosity by much.