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.surface.PolyMesh

class nilearn.surface.PolyMesh(left=None, right=None)[source]

A collection of meshes.

It is a shallow wrapper around the parts dictionary, which cannot be empty and whose keys must be a subset of {“left”, “right”}.

Parameters:
leftstr or pathlib.Path or nilearn.surface.SurfaceMesh or None, default=None

Mesh for the left hemisphere.

rightstr or pathlib.Path or nilearn.surface.SurfaceMesh or None, default=None

Mesh for the right hemisphere.

Attributes:
n_verticesint

number of vertices

__init__(left=None, right=None)[source]
n_vertices
to_filename(filename)[source]

Save mesh to gifti.

Parameters:
filenamestr or pathlib.Path

If the filename contains hemi-L then only the left part of the mesh will be saved. If the filename contains hemi-R then only the right part of the mesh will be saved. If the filename contains neither of those, then _hemi-L and _hemi-R will be appended to the filename and both will be saved.

Examples using nilearn.surface.PolyMesh

Working with Surface images

Working with Surface images