- trim_disconnected_blobs(im, inlets, strel=None)#
Removes foreground voxels not connected to specified inlets.
im (ndarray) – The image containing the blobs to be trimmed
inlets (ndarray or tuple of indices) – The locations of the inlets. Can either be a boolean mask the same shape as
im, or a tuple of indices such as that returned by the
wherefunction. Any voxels not connected directly to the inlets will be trimmed.
strel (array-like) – The neighborhood over which connectivity should be checked. It must be symmetric and the same dimensionality as the image. It is passed directly to the
scipy.ndimage.labelfunction as the
structureargument so refer to that docstring for additional info.
image – An array of the same shape as
im, but with all foreground voxels not connected to the
- Return type:
Click here to view online example.