ibip¶
- ibip(im: ndarray[Any, dtype[_ScalarType_co]], inlets: ndarray[Any, dtype[_ScalarType_co]] = None, outlets: ndarray[Any, dtype[_ScalarType_co]] = None, dt: ndarray[Any, dtype[_ScalarType_co]] = None, maxiter: int = 10000, return_sizes: bool = True, conn: str = 'min', min_size: int = 0)[source]¶
Simulates non-wetting fluid injection on an image using the IBIP algorithm [1]
- Parameters:
im (ND-array) – Boolean array with
True
values indicating void voxelsinlets (ND-array) – Boolean array with
True
values indicating where the invading fluid is injected from. IfNone
, all faces will be used.dt (ND-array (optional)) – The distance transform of
im
. If not provided it will be calculated, so supplying it saves time.maxiter (scalar) – The number of steps to apply before stopping. The default is to run for 10,000 steps which is almost certain to reach completion if the image is smaller than about 250-cubed.
return_sizes (bool) – If True then an array containing the size of the sphere which first overlapped each voxel is returned. This array is not computed by default as it increases computation time.
- Returns:
results – A dataclass-like object with the following arrays as attributes:
Attribute
Description
im_seq
A numpy array with each voxel value containing the step at which it was invaded. Uninvaded voxels are set to -1.
im_snwp
A numpy array with each voxel value indicating the saturation present in the domain it was invaded. Solids are given 0, and uninvaded regions are given -1.
im_size
If return_sizes was set to True, then a numpy array with each voxel containing the radius of the sphere, in voxels, that first overlapped it.
- Return type:
dataclass-like
References
Notes
This function is slower and is less capable than qbip, which returns identical results, so it is recommended to use that instead.