- pseudo_gravity_packing(im, r, clearance=0, axis=0, maxiter=1000)¶
Iteratively inserts spheres at the lowest accessible point in an image, mimicking a gravity packing.
im (ndarray) – Image with
Truevalues 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
spheres – An image the same size as
imwith spheres indicated by
True. The spheres are only inserted at locations that are accessible from the top of the image.
- Return type