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.grid2text(vertices, proj)[source]ΒΆ

Convert a grided-texture into a spherical surface. Nearest-neighbor interpolation is used to convert data from the 2-D grid to the 3-D surface.

Parameters:

vertices : array (N, 3)

x, y, z coordinates of an icosahedron.

proj : array (resx, resy)

the grided-texture.

Returns:

texture : array (N, )

the input icosahedron texture.

See also

text2grid

Examples

>>> from surfify.utils import icosahedron, grid2text
>>> import matplotlib.pyplot as plt
>>> from surfify.plotting import plot_trisurf
>>> ico2_verts, ico2_tris = icosahedron(order=2)
>>> y_grid = np.zeros((192, 192), dtype=int)
>>> y_grid[:, :96] = 1
>>> y = grid2text(ico2_verts, y_grid)
>>> plot_trisurf(ico2_verts, triangles=ico2_tris, texture=y,
                 is_label=True)
>>> plt.show()

Follow us

© 2025, nidl developers