mesh_region#

mesh_region(region: bool, strel=None)[source]#

Creates a tri-mesh of the provided region using the marching cubes algorithm

Parameters:
  • im (ndarray) – A boolean image with True values indicating the region of interest

  • strel (ndarray) – The structuring element to use when blurring the region. The blur is perfomed using a simple convolution filter. The point is to create a greyscale region to allow the marching cubes algorithm some freedom to conform the mesh to the surface. As the size of strel increases the region will become increasingly blurred and inaccurate. The default is a spherical element with a radius of 1.

Returns:

mesh – A named-tuple containing faces, verts, norm, and val as returned by scikit-image.measure.marching_cubes function.

Return type:

tuple

Examples

Click here to view online example.