Fill voids (holes) in 3D binary images (numpy arrays) using a flood-fill algorithm. Fast and memory-efficient algorithm for hole filling in labeled or binary volumes. Current version 2.1.2, released Oct 2024. Releases are occasional, with breaking changes in the past (e.g., v2.0).
pip install fill-voidsVerified import paths — ran on the pinned version, not inferred.
Fills holes in a 3D binary numpy array.
Update import to 'from fill_voids import fill_voids' and call fill_voids() instead of fill().
Ensure input is 3D (shape (Z, Y, X)). For 2D, reshape: image_3d = image[np.newaxis, ...]; then fill; then squeeze.
Pad the array with a border of foreground voxels before filling, or use the 'in_place' argument if available.
Use in_place=False (default) to preserve input; copy the array first if needed.