find_disconnected_voxels#

find_disconnected_voxels(im, conn=None, surface=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 (int) – For 2D the options are 4 and 8 for square and diagonal neighbors, while for the 3D the options are 6 and 26, similarily for square and diagonal neighbors. The default is the maximum option.

  • 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

Notes

This function is just a convenient wrapper around the clear_border function of scikit-image.

Examples

Click here to view online example.