porespy.filters.local_thickness_bf#
- porespy.filters.local_thickness_bf(im, dt=None, mask=None, smooth=True, sizes=None, return_indices=False)#
Insert a maximally inscribed sphere at every pixel labelled by sphere radius
- Parameters:
im (ndarray) – Boolean image of the porous material
dt (ndarray, optional) – The distance transform of the image
mask (ndarray, optional) – A boolean mask indicating which sites to insert spheres at. If not provided then all True values in im are used.
smooth (bool, optional) – Indicates if protrusions should be removed from the faces of the spheres or not. Default is True.
sizes (array_like or scalar) – The positive integer radii to evaluate. An integer N selects up to N evenly spaced integer radii between 1 and
floor(dt.max()). If None, every integer radius in that range is used.return_indices (bool, optional) – If True, return
(sizes, indices)instead of a float image, wheresizes[indices]reconstructs the usual result. Default is False.
- Returns:
lt – The local thickness of the image with each voxel labelled according to the radius of the largest sphere which overlaps it, or
(sizes, indices)when return_indices is True.- Return type:
ndarray or tuple[ndarray, ndarray]
Notes
Consecutive radii rasterize only the new distance-transform shell and discard spheres contained by the preceding shell. When requested radii contain gaps, the threshold is filled directly and spheres are rasterized only from its interface. Shells write labels directly, while interfaces build a cumulative boolean union using adaptive direct or merged parallel scan-line writes.
Examples
Click here to view online example.