pseudo_electrostatic_packing(im, r, sites=None, clearance=0, protrusion=0, max_iter=1000)¶
Iterativley inserts spheres as close to the given sites as possible.
im (ndarray) – Image with
Truevalues indicating the phase where spheres should be inserted.
r (int) – Radius of spheres to insert.
sites (ndarray (optional)) – An image with
Truevalues indicating the electrostatic attraction points. If this is not given then the peaks in the distance transform are used.
clearance (int (optional, default=0)) – The amount of space to put between each sphere. Negative values are acceptable to create overlaps, but abs(clearance) < r.
protrusion (int (optional, default=0)) – The amount that spheres are allowed to protrude beyond the active phase.
max_iter (int (optional, default=1000)) – The maximum number of spheres to insert.
im – An image with inserted spheres indicated by
- Return type