porespy.filters.snow_partitioning_parallel#
- porespy.filters.snow_partitioning_parallel(im, r_max=4, sigma=0.4, parallel_kw={})#
Performs SNOW algorithm in parallel (or serial) to reduce time (or memory usage) by geomertirc domain decomposition of large images.
- 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. 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:
regions – Partitioned image of segmentated regions with unique labels. Each region correspond to pore body while intersection with other region correspond throat area.
- Return type:
ndarray
Examples
Click here to view online example.