find_disconnected_voxels

find_disconnected_voxels(im: ndarray[Any, dtype[_ScalarType_co]], conn: Literal['min', 'max'] = 'max', surface: bool = False)[source]

Identifies all voxels that are not connected to the edge of the image.

Parameters:
  • im (ndarray) – A Boolean image, with True values indicating the phase for which disconnected voxels are sought.

  • conn (str) – Can be either ‘min’ or ‘max’ and controls the shape of the structuring element used to determine voxel connectivity. The default if ‘min’ which imposes the strictest criteria, so that voxels must share a face to be considered connected.

  • fill_surface (bool) – If True any isolated regions touching the edge of the image are considered disconnected.

Returns:

image – An ndarray the same size as im, with True values indicating voxels of the phase of interest (i.e. True values in the original image) that are not connected to the outer edges.

Return type:

ndarray

Examples

Click here to view online example.