size_to_pc¶
- size_to_pc(im, size, f=None, **kwargs)[source]¶
Converts size map into capillary pressure map
- Parameters:
im (ndarray) – A Numpy array with
True
values indicating the void space.size (ndarray) – The image containing invasion size values in each voxel. Solid should be indicated as 0’s and uninvaded voxels as -1.
f (function handle, optional) – A function to compute the capillary pressure which receives size as the first argument, followed by any additional **kwargs. If not provided then the Washburn equation is used, which requires theta and sigma to be specified as additional keyword arguments.
**kwargs (Key word arguments) – All additional keyword arguments are passed on to f.
- Returns:
pc – An image with each voxel containing the capillary pressure at which it was invaded. Any uninvaded voxels in size are set to np.inf which is meant to indicate that these voxels are never invaded.
- Return type:
ndarray
Notes
The function f should be of the form:
def func(r, a, b): pc = ... # Some equation for capillary pressure using r, a and b return pc