fill_closed_pores

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

Fills all closed pores that are isolated from the main void space.

Parameters:

im (ndarray) – The image of the porous material

Returns:

  • im (ndarray) – A Boolean image, with True values indicating the phase of interest.

  • 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 pore regions that are connected to the sufaces of the image are but not connected to the main percolating path are also removed. When this is enabled, only the voxels belonging to the largest region are kept. This can be problematic if image contains non-intersecting tube-like structures, for instance, since only the largest tube will be preserved.

Returns:

im – A version of im but with all the closed or disconnected pores converted to solid (i.e. False)

Return type:

ndarray

Examples

Click here to view online example.