Generate Artificial Images

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

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

Generates an image containing amorphous blobs

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.cylindrical_plug(shape[, r, axis])

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

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

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

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(im, r)

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

generators.pseudo_gravity_packing(im, r[, …])

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

generators.RSA(im_or_shape, r[, …])

Generates a sphere or disk packing using Random Sequential Addition

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

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, r, ncells[, …])

Create an image from the edges of a Voronoi tessellation.