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.downsample_ico(vertices, triangles, by=1, down_indices=None)[source]

Downsample an icosahedron full geometry: vertices and triangles.

Parameters:

vertices : array (N, 3)

vertices of the icosahedron to reduce.

triangles : array (M, 3)

triangles of the icosahedron to reduce.

by : int, default 1

number of orders to reduce the icosahedron by.

down_indices : list of array, default None

optionally specify the list of consecutive downsampling vertices indices.

Returns:

new_vertices : array (N’, 3)

vertices of the newly downsampled icosahedorn.

new_triangles : array (M’, 3)

triangles of the newly downsampled icosahedron.

Examples

>>> from surfify.utils import icosahedron, downsample_ico
>>> import matplotlib.pyplot as plt
>>> from surfify.plotting import plot_trisurf
>>> ico4_verts, ico4_tris = icosahedron(order=4)
>>> ico2_down_verts, ico2_down_tris = downsample_ico(
        ico4_verts, ico4_tris, by=2)
>>> plot_trisurf(ico2_down_verts, triangles=ico2_down_tris, colorbar=False)
>>> plt.show()

Follow us

© 2025, nidl developers