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_data(data, by=1, down_indices=None)[source]ΒΆ
Downsample data/texture on the icosahedron to a lower order.
- Parameters:
data : array (n_samples, n_vertices, n_features)
data to be downsampled.
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:
downsampled_data : array (n_samples, new_n_vertices, n_features)
downsampled data.
See also
Examples
>>> from surfify.utils import icosahedron, downsample_data >>> from surfify.datasets import make_classification >>> import matplotlib.pyplot as plt >>> from surfify.plotting import plot_trisurf >>> ico2_verts, ico2_tris = icosahedron(order=2) >>> ico4_verts, ico4_tris = icosahedron(order=4) >>> X, y = make_classification(ico4_verts, n_samples=1, n_classes=3, scale=1, seed=42) >>> y = y.reshape(1, -1, 1) >>> y_down = downsample_data(y, by=2).squeeze() >>> plot_trisurf(ico2_verts, triangles=ico2_tris, texture=y_down, is_label=True) >>> plt.show()
Follow us