Skip to content

upper_envelope

upper_envelope(V, T, D)

Slices tet mesh according per-vertex material soft labels

Parameters:

Name Type Description Default
V numpy double array

Matrix of tet mesh vertex coordinates

required
T numpy int array

Matrix of tet mesh indices into V

required
D numpy double array

Matrix of per-vertex labels: each column corresponds to a different material and has per-vertex soft labels between zero and one

required

Returns:

Name Type Description
U numpy double array

Matrix of sliced, output tet mesh vertex coordinates

G numpy int array

Matrix of sliced, output tet mesh indices into U

LT numpy int array

Matrix of hard per-tet labels: in the same style of D, but only taking values one and zero.

Notes

This uses the algorithm described by Abdrashitov et al. in "Interactive Modelling of Volumetric Musculoskeletal Anatomy". We thank the first author, Rinat Abdrashitov, for providing an initial version of the code.

Examples:

TODO

Source code in src/gpytoolbox/upper_envelope.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def upper_envelope(V,T,D):
    """Slices tet mesh according per-vertex material soft labels

    Parameters
    ----------
    V : numpy double array
        Matrix of tet mesh vertex coordinates
    T : numpy int array
        Matrix of tet mesh indices into V
    D : numpy double array
        Matrix of per-vertex labels: each column corresponds to a different material and has per-vertex soft labels between zero and one

    Returns
    -------
    U : numpy double array
        Matrix of sliced, output tet mesh vertex coordinates
    G : numpy int array
        Matrix of sliced, output tet mesh indices into U
    LT : numpy int array
        Matrix of hard per-tet labels: in the same style of D, but only taking values one and zero.

    Notes
    -----
    This uses the algorithm described by Abdrashitov et al. in "Interactive Modelling of Volumetric Musculoskeletal Anatomy". We thank the first author, Rinat Abdrashitov, for providing an initial version of the code.

    Examples
    --------
    TODO
    """

    try:
        from gpytoolbox_bindings import _upper_envelope_cpp_impl
    except:
        raise ImportError("Gpytoolbox cannot import its C++ binding.")

    ut, gt, lt = _upper_envelope_cpp_impl(V,T.astype(np.int32),D)

    return ut, gt, lt