trim_nonpercolating_paths#

trim_nonpercolating_paths(im, inlets, outlets, strel=None)[source]#

Remove all nonpercolating paths between specified locations

Parameters
  • im (ndarray) – The image of the porous material with `True values indicating the phase of interest

  • inlets (ndarray) – A boolean mask indicating locations of inlets, such as produced by porespy.generators.faces.

  • outlets (ndarray) – A boolean mask indicating locations of outlets, such as produced by porespy.generators.faces.

  • strel (ndarray) – The structuring element to use when determining if regions are connected. This is passed to scipiy.ndimage.label.

Returns

image – A copy of im with all the nonpercolating paths removed

Return type

ndarray

Notes

This function is essential when performing transport simulations on an image since regions that do not span between the desired inlet and outlet do not contribute to the transport.

See also

find_disconnected_voxels, trim_floating_solid, trim_blind_pores

Examples

Click here to view online example.