- size_to_seq(size, im=None, bins=None, mode='drainage')#
Converts an image of invasion size values into invasion sequence values
size (ndarray) – The image containing invasion size in each voxel. Values of 0 are assumed to be solid (if
imis not given) and values of -1 are assumed to be uninvaded.
im (ndarray, optional) – A binary image of the porous media, with
Trueindicating the void space and
Falseindicating the solid phase. If not given then it is assumed that the solid is identified as
size == 0.
bins (array_like or int (optional)) – The bins to use when converting sizes to sequence. The default is to create 1 bin for each unique value in
size(except for -1 and 0). If an int is supplied, it is interpreted as the number of bins between 1 and the maximum value in
size. If an array is supplied it is used as the bins directly.
mode (str) –
Controls how the sizes are converted to a sequence. The options are:
The sizes are assumed to have been filled from largest to smallest, ignoring 0’s and -1’s
The sizes are assumed to have been filled from smallest to largest, ignoring 0’s and -1’s
seq – An ndarray the same shape as
sizewith invasion size values replaced by the invasion sequence, according to the specified mode. Any uninvaded voxels, indicated by -1 in
sizewill be indicated by -1 in
- Return type:
Click here to view online example.