nanomesh.image2meshο
Functions:
|
Generate a triangular mesh from a 2D segmented image. |
|
Generate a tetrahedral mesh from a 3D segmented image. |
- nanomesh.image2mesh.plane2mesh(image: np.ndarray | Plane, *, level: float = None, max_edge_dist: int = 5, opts: str = 'q30a10', plot: bool = False) MeshContainer [source]ο
Generate a triangular mesh from a 2D segmented image.
- Parameters
image ((i,j) numpy.ndarray or Plane) β Input image to mesh.
level (float, optional) β Level to generate contours at from image
max_edge_dist (int, optional) β Maximum distance between neighbouring pixels in contours.
opts (str, optional) β Options passed to
triangulate()
. For more info, see: https://rufat.be/triangle/API.html#triangle.triangulate
- Returns
mesh β Triangulated 2D mesh with domain labels.
- Return type
- nanomesh.image2mesh.volume2mesh(image: np.ndarray | Volume, *, level: float = None, **kwargs) MeshContainer [source]ο
Generate a tetrahedral mesh from a 3D segmented image.
- Parameters
image ((i,j,k) numpy.ndarray or Volume) β Input image to mesh.
level (float, optional) β Contour value to search for isosurfaces (i.e. the threshold value). By default takes the average of the min and max value. Can be ignored if a binary image is passed as image.
**kwargs β Optional keyword arguments passed to
tetrahedralize()
- Returns
volume_mesh β Instance of
MeshContainer
- Return type