pumapy.segmentation

pumapy.segmentation.porespace

pumapy.segmentation.porespace.fill_closed_pores(workspace, solid_cutoff, fill_value, return_pores=False)[source]

Identify the porespace and fill closed porosity

Parameters
  • workspace (Workspace) – domain

  • solid_cutoff (tuple(int, int)) – specify the solid range to discard from pores identification

  • fill_value (int) – value to fill closed porosity with

  • return_pores (bool, optional) – specifies whether to return identified pores

Returns

filled workspace with IDs set as: 0 for void, 1 for solid, fill_value for added filler material. In addition, if return_pores==True, then it also returns the porespace marked as: 0 solid, 1 largest pore (likely open porosity), >1 other pores

Return type

Workspace

Example

>>> import pumapy as puma
>>> ws = puma.generate_random_spheres((200, 200, 200), diameter=20, porosity=0.8, allow_intersect=True)
>>> ws.binarize_range((0, 128))  # invert material, i.e. consider spheres as pores
>>> filled_ws, pores = puma.fill_closed_pores(ws, solid_cutoff=(1, 1), fill_value=2, return_pores=True)
>>> puma.render_volume(pores, (1, pores.max()), solid_color=None, cmap='jet')
>>> puma.render_volume(filled_ws)
pumapy.segmentation.porespace.identify_porespace(workspace, solid_cutoff)[source]

Identify the porespace

Parameters
  • workspace (Workspace) – domain

  • solid_cutoff (tuple(int, int)) – specify the solid range to discard from pores identification

Returns

porespace marked as: 0 solid, 1 largest pore (likely open porosity), >1 other pores

Return type

ndarray

Example

>>> import pumapy as puma
>>> ws = puma.generate_random_spheres((200, 200, 200), diameter=20, porosity=0.8, allow_intersect=True)
>>> ws.binarize_range((0, 128))  # invert material, i.e. consider spheres as pores
>>> pores = puma.identify_porespace(ws, (1, 1))
>>> puma.render_volume(pores, (1, pores.max()), solid_color=None, cmap='jet')