porespy.tools.get_slices_random#

porespy.tools.get_slices_random(im, n=1000, lims=[10, 100], aspect=None)#

Generates a list of slice objects which can be used to obtain cubic subdomains of random size and location from the image

Parameters:
  • im (ndarry) – The image of the porous material

  • n (int) – The number of random subdomains to be generated

  • lims (list) – The minimum and maximum size for the subdomains to be generated

  • aspect (array_like, optional) – The aspect ratio of returned slices, with a value for each axis. If not given the slices will be cubic (default). If True then they will have the same aspect ratio as the image.

Returns:

new_slices – A list containing slice objects which can be iterated over to access the image slices.

Return type:

list