kernels.grow_mask
kernels.grow_mask(mask, grow, *, validate=True)Dilate a stack mask over spatial axes by an exact Euclidean radius.
Axis 0 is the stack axis and is never grown across. For each input plane, every True sample marks all spatial samples whose integer-grid Euclidean distance is less than or equal to grow.
Parameters
mask : ndarray of bool, shape (N, *spatial)-
Rejection mask to grow.
Truevalues are expanded within each plane. grow : float-
Non-negative radius in pixels.
0returns an unchanged copy. Values below1grow no additional integer-grid samples. validate : bool = True-
If
True, validate dimensionality, dtype, finiteness, and contiguity before entering the Rust kernel. IfFalse, callers must provide a C-contiguous boolean array with at least two dimensions and a finite non-negative radius.
Returns
grown : ndarray of bool, shape (N, *spatial)-
Grown mask with the same shape as
mask.