porespy.networks.skeleton_parallel#
- porespy.networks.skeleton_parallel(im, parallel_kw={})#
Performs skimage.morphology.skeleton_3d in parallel using dask
- Parameters:
im (ndarray) – A binary image of porous media with ‘True’ values indicating phase of interest.
parallel_kw (dict) –
Dictionary containing the settings for parallelization by chunking. If not provided, the defaults in ps.settings are used!
The optional settings include divs (scalar or list of scalars, default = [2, 2, 2]), overlap (scalar or list of scalars, optional), and cores (scalar, default is all available cores).
divs is the number of times to divide the image for parallel processing. If 1 then parallel processing does not occur. 2 is equivalent to [2, 2, 2] for a 3D image. If a list is provided, each respective axis will be divided by its corresponding number in the list. For example, [2, 3, 4] will divide z, y, and x axis to 2, 3, and 4 respectively.
overlap is the amount of overlap to include when dividing up the image. This value will almost always be the size (i.e. raduis) of the structuring element. If not specified then the amount of overlap is inferred from the size of the structuring element, in which case the strel_arg must be specified.
cores is the number of cores that will be used to parallel process all domains. If
None
then all cores will be used but user can specify any integer values to control the memory usage. Setting value to 1 will effectively process the chunks in serial to minimize memory usage.
- Returns:
sk – Skeleton of image
- Return type:
ndarray