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.coord.ico2ico(vertices, ref_vertices)[source]ΒΆ

Find a mapping between two icosahedrons: a simple rotation is estimated by identifying 4 vertices with same coordinates up to their signs and then finding the best rotation using permutations.

Parameters:

vertices : array (N, 3)

the vertices to project.

ref_vertices : array (N, 3)

the reference/target vertices.

Returns:

rotation : scipy.spatial.tranform.Rotation

the rotation that transforms the vertices to the reference.

See also

text2ico

Examples

>>> from surfify.utils import icosahedron, ico2ico
>>> import matplotlib.pyplot as plt
>>> from surfify.plotting import plot_trisurf
>>> ico2_verts, ico2_tris = icosahedron(order=2)
>>> ico2_std_verts, ico2_std_tris = icosahedron(order=2, standard_ico=True)
>>> rotation = ico2ico(ico2_verts, ico2_std_verts)
>>> fig, ax = plt.subplots(1, 1, subplot_kw={
        "projection": "3d", "aspect": "auto"}, figsize=(10, 10))
>>> plot_trisurf(ico2_std_verts, triangles=ico2_std_tris, colorbar=False,
                 fig=fig, ax=ax, alpha=0.3, edgecolors="blue")
>>> plot_trisurf(rotation.apply(ico2_verts), triangles=ico2_tris,
                 colorbar=False, fig=fig, ax=ax, alpha=0.3,
                 edgecolors="green")
>>> plt.show()

Follow us

© 2025, nidl developers