ibip_gpu#

ibip_gpu(im, dt=None, inlets=None, maxiter=10000)[source]#

Performs invasion percolation on given image using iterative image dilation on GPU.

Parameters:
  • im (array_like) – Boolean array with True values indicating void voxels. If a standard numpy array is passed, it is converted to a cupy array.

  • dt (array_like, optional) – The distance transform of im. If a standard numpy array is passed, it is converted to a cupy array.

  • inlets (array_like, optional) – Boolean array with True values indicating where the invading fluid is injected from. If None, all faces will be used. If a standard numpy array is passed, it is converted to a cupy array.

  • maxiter (int, optional) – 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.

Returns:

results – A custom object with the following two arrays as attributes:

’inv_sequence’

An ndarray the same shape as im with each voxel labelled by the sequence at which it was invaded.

’inv_size’

An ndarray the same shape as im with each voxel labelled by the inv_size at which was filled.

Return type:

Results object