trim_nonpercolating_paths¶
- trim_nonpercolating_paths(im: ndarray[Any, dtype[_ScalarType_co]], axis: int = None, inlets: ndarray[Any, dtype[_ScalarType_co]] = None, outlets: ndarray[Any, dtype[_ScalarType_co]] = None, conn: Literal['max', 'min'] = 'min')[source]¶
Remove all nonpercolating pores between specified locations
- Parameters:
im (ndarray) – The image of the porous material with True values indicating the phase of interest
axis (int, optional) – An integer indicating that axis along which the inlet and outlet faces should be applied. For instance if axis=0 then the inlets will be at im[0, …] and the outlets will be at im[-1, …]. If this argument is given then inlets and outlets are ignored.
outlets (inlets) – A boolean mask indicating locations of inlets and outlets, such as produced by porespy.generators.faces. This can be used instead of axis to provide more control. This is ignored if axis is provided.
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.
- 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.
Examples
Click here to view online example.