Note

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

nilearn.experimental.surface.SurfaceImage

class nilearn.experimental.surface.SurfaceImage(mesh, data)[source]

Surface image, usually containing meshes & data for both hemispheres.

Parameters:
meshPolyMesh | dict[str, Mesh | str | Path]
dataPolyData | dict[str, Mesh | str | Path]
Attributes:
shape(int, int)

shape of the surface data array

__init__(mesh, data)[source]

Create a SurfaceImage instance.

classmethod from_volume(mesh, volume_img, inner_mesh=None, **vol_to_surf_kwargs)[source]

Create surface image from volume image.

Parameters:
meshPolyMesh or dict[str, Mesh | str | Path]

Surface mesh.

volume_imgNiimg-like object

3D or 4D volume image to project to the surface mesh.

inner_mesh: PolyMesh or dict[str, Mesh | str | Path], optional

Inner mesh to pass to nilearn.surface.vol_to_surf.

vol_to_surf_kwargs: dict[str, Any]

Dictionary of extra key-words arguments to pass to nilearn.surface.vol_to_surf.

Examples

>>> from nilearn.experimental.surface import (
...     SurfaceImage,
...     load_fsaverage,
... )
>>> from nilearn.datasets import load_sample_motor_activation_image
>>> fsavg = load_fsaverage()
>>> vol_img = load_sample_motor_activation_image()
>>> img = SurfaceImage.from_volume(fsavg["white_matter"], vol_img)
>>> img
<SurfaceImage (20484,)>
>>> img = SurfaceImage.from_volume(
...     fsavg["white_matter"], vol_img, inner_mesh=fsavg["pial"]
... )
>>> img
<SurfaceImage (20484,)>

Examples using nilearn.experimental.surface.SurfaceImage

Seed-based connectivity on the surface

Seed-based connectivity on the surface

Example of surface-based first-level analysis

Example of surface-based first-level analysis

Surface-based dataset first and second level analysis of a dataset

Surface-based dataset first and second level analysis of a dataset

Loading and plotting of a cortical surface atlas

Loading and plotting of a cortical surface atlas

A short demo of the surface images & maskers

A short demo of the surface images & maskers

Making a surface plot of a 3D statistical map

Making a surface plot of a 3D statistical map