generators#

Collection of functions for generating synthetic images#

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

generators.random_spheres([shape, im, r, ...])

Generates a sphere or disk packing using random sequential addition as described by Torquato [1]_.

generators.blobs(shape[, porosity, ...])

Generates an image containing amorphous blobs

generators.borders(shape[, thickness, mode])

Creates an array of specified size with corners, edges or faces labelled as True.

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

Create a 3D image of a bundle of tubes, in the form of a rectangular plate with randomly sized holes through it.

generators.cylinders(shape, r[, ncylinders, ...])

Generates a binary image of overlapping cylinders given porosity OR number of cylinders.

generators.cylindrical_plug(shape[, r, axis])

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

generators.faces(shape[, inlet, outlet])

Generate an image with True values on the specified inlet and outlet faces

generators.fractal_noise(shape[, frequency, ...])

Generate fractal noise which can be thresholded to create binary images with realistic structures across scales.

generators.insert_shape(im, element[, ...])

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

generators.lattice_spheres(shape[, r, ...])

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

generators.line_segment(X0, X1)

Calculate the voxel coordinates of a straight line between the two given end points

generators.overlapping_spheres(shape[, r, ...])

Generate a packing of overlapping mono-disperse spheres

generators.polydisperse_spheres(shape, ...)

Create an image of randomly placed, overlapping spheres with a distribution of radii.

generators.pseudo_electrostatic_packing([...])

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

generators.pseudo_gravity_packing([shape, ...])

Iteratively inserts spheres at the lowest accessible point in an image, mimicking a gravity packing.

generators.random_cantor_dust(shape[, n, p, ...])

Generates an image of random cantor dust

generators.sierpinski_foam([dmin, n, ndim, ...])

Generates an image of a Sierpinski carpet or foam

generators.voronoi_edges(shape, ncells[, r, ...])

Create an image from the edges of a Voronoi tessellation.