porespy.generators#

This module contains a variety of functions for generating artificial images of porous materials, generally for testing, validation, debugging, and illustration purposes.

Functions#

blobs(shape[, porosity, blobiness, parallel_kw, seed, ...])

Generates an image containing amorphous blobs

borders(shape[, thickness, mode])

Creates an array of specified size with corners, edges or faces

bundle_of_tubes(shape, spacing[, distribution, ...])

Create a 3D image of a bundle of tubes, in the form of a rectangular

cylinders(shape, r[, ncylinders, porosity, phi_max, ...])

Generates a binary image of overlapping cylinders given porosity OR

cylindrical_pillars_array(shape[, spacing, dist, ...])

A 2D micromodel with cylindrical pillars positioned on a lattice

cylindrical_pillars_mesh(shape[, f, a, n, truncate])

A 2D micromodel with randomly located cylindrical pillars of random radius

cylindrical_plug(shape[, r, axis])

Generates a cylindrical plug suitable for use as a mask on a tomogram

elevation(shape, voxel_size[, axis])

Generates a image of distances from given axis

faces(shape[, inlet, outlet])

Generate an image with True values on the specified inlet and

fractal_noise(shape[, porosity, frequency, octaves, ...])

Generate fractal noise with realistic structures across scales.

insert_shape(im, element[, center, corner, value, mode])

Inserts sub-image into a larger image at the specified location.

lattice_spheres(shape[, r, spacing, offset, smooth, ...])

Generate a cubic packing of spheres in a specified lattice arrangement.

line_segment(X0, X1)

Calculate the voxel coordinates of a straight line between the two

overlapping_spheres(shape[, r, porosity, maxiter, ...])

Generate a packing of overlapping mono-disperse spheres

polydisperse_spheres(shape, porosity, dist[, nbins, ...])

Create an image of randomly placed, overlapping spheres with a

pseudo_electrostatic_packing([shape, im, r, sites, ...])

Iterativley inserts spheres as close to the given sites as possible.

pseudo_gravity_packing(→ numpy.ndarray)

Iteratively inserts spheres at the lowest accessible point in an image,

ramp(shape[, inlet, outlet, axis])

Generates an array containing a linear ramp of greyscale values along the given

random_cantor_dust(shape[, n, p, f, seed])

Generates an image of random cantor dust

random_spheres([shape, im, r, clearance, protrusion, ...])

Generates a sphere or disk packing using random sequential addition as

rectangular_pillars_array(shape[, spacing, dist, ...])

A 2D micromodel with rectangular pillars positioned on a lattice

sierpinski_foam(shape[, n, mode])

Generates an image of a Sierpinski carpet or foam with independent control of

spheres_from_coords(df[, mode, smooth])

Generates a sphere packing given a list of centers and radii

voronoi_edges(shape, ncells[, r, flat_faces, seed])

Create an image from the edges of a Voronoi tessellation.