Menu

Deep learning for NeuroImaging in Python.

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the gallery for the big picture.

surfify.utils.sampling.order_triangles(vertices, triangles, clockwise_from_center=True)[source]

Order the icosahedron triangles to be in a clockwise order when viewed from the center of the sphere. Used by the ‘find_rotation_interpol_coefs’ for barycentric interpolation.

Parameters:

vertices : array (N, 3)

the icosahedron’s vertices.

triangles : array (M, 3)

the icosahedron’s triangles.

clockwise_from_center : bool, default True

optionally use counter clockwise order.

Returns:

reordered_triangles : array (M, 3)

reordered triangles.

Examples

>>> from surfify.utils import icosahedron, order_triangles
>>> ico0_verts, ico0_tris = icosahedron(order=0)
>>> clockwise_ico0_tris = order_triangles(
        ico0_verts, ico0_tris, clockwise_from_center=True)
>>> counter_clockwise_ico0_tris = order_triangles(
        ico0_verts, ico0_tris, clockwise_from_center=False)
>>> print(clockwise_ico0_tris)
>>> print(counter_clockwise_ico0_tris)

Follow us

© 2025, nidl developers