pseudo_gravity_packing

pseudo_gravity_packing(im, r, clearance=0, axis=0, maxiter=1000)[source]

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

Parameters
  • im (ndarray) – Image with True values indicating the phase where spheres should be inserted. A common option would be a cylindrical plug which would result in a tube filled with beads.

  • r (int) – The radius of the spheres to be added

  • clearance (int (default is 0)) – The amount space to add between neighboring spheres. The value can be negative for overlapping spheres, but abs(clearance) > r.

  • axis (int (default is 0)) – The axis along which gravity acts.

  • maxiter (int (default is 1000)) – The maximum number of spheres to add

Returns

spheres – An image the same size as im with spheres indicated by True. The spheres are only inserted at locations that are accessible from the top of the image.

Return type

ndarray