trim_floating_solid

trim_floating_solid(im, conn=None)[source]

Removes all solid that that is not attached to the edges of the image.

Parameters
  • im (ndarray) – The image of the porous material

  • 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.

Returns

image – A version of im but with all the disconnected solid removed.

Return type

ndarray

Examples

Click here to view online example.