neurodec.mdt.Tetrahedra#

class neurodec.mdt.Tetrahedra(dictionary: dict)#

A labelled tetrahedral mesh.

classmethod from_image(image: Image, sizes: float = 0.001, distance: float = 0.001, force_computation: bool = False) Tetrahedra#

Create a labelled tetrahedral mesh from a set of voxels.

Parameters
  • image – The labelled 3D image from which the tetrahedral mesh should be extracted.

  • sizes – This parameter controls the size of surface facets. Each surface facet has a surface Delaunay ball which is a ball circumscribing the surface facet and centered on the surface patch.

  • distance – This parameter controls the approximation error of boundary and subdivision surfaces. It provides an upper bound for the distance between the circumcenter of a surface facet and the center of a surface Delaunay ball of this facet.

  • force_computation – Boolean flag that allows to bypass a status check. Normally, the API would check if an object with the requested parameters was already present in the database. If this was the case, the API would not request its computation and would simply return its identifier. By setting this flag to True, the user can bypass this logic and force the computation of the resource even if it existed already. The main reason is to allow starting a calculation again in case of unexpected errors.

Returns

The metadata of the new tetrahedra. If another object with the same parameters already exits, that one will be returned instead of building a new one.

classmethod from_surfaces(surfaces: Collection[Surface], sizes: float = 0.001, distance: float = 0.001, force_computation: bool = False) Tetrahedra#

Create a labelled tetrahedral mesh from a set of surfaces.

Parameters
  • surfaces – The surface meshes from which the tetrahedral mesh should be built. There must be exactly one surface of type TissueType.SKIN, one of type TissueType.SKIN and at least one of type TissueType.MUSCLE.

  • sizes – This parameter controls the size of surface facets. Each surface facet has a surface Delaunay ball which is a ball circumscribing the surface facet and centered on the surface patch.

  • distance – This parameter controls the approximation error of boundary and subdivision surfaces. It provides an upper bound for the distance between the circumcenter of a surface facet and the center of a surface Delaunay ball of this facet.

  • force_computation – Boolean flag that allows to bypass a status check. Normally, the API would check if an object with the requested parameters was already present in the database. If this was the case, the API would not request its computation and would simply return its identifier. By setting this flag to True, the user can bypass this logic and force the computation of the resource even if it existed already. The main reason is to allow starting a calculation again in case of unexpected errors.

Returns

The metadata of the new tetrahedra. If another object with the same parameters already exits, that one will be returned instead of building a new one.

property id: int#

Returns the ID of the object

property muscles#

Retrieve the muscle surfaces of this mesh.

Returns

A list of Surface objects representing the muscles of the mesh. If this Tetrahedra object was created from an Image, the surfaces are extracted from the mesh once the image is processed. If the object was created from a set of surfaces, these surfaces are the same that were given as input.

property skin#

Retrieve the skin surface of this mesh.

Returns

A Surface object representing the skin of the mesh. If this Tetrahedra object was created from an Image, the surface is extracted from the mesh once the image is processed. If the object was created from a set of surfaces, this surface is the same that was given as input.

property status: Status#

Returns the up-to-date status of the object, by performing an API request.

wait()#

Wait for the object to be ready