mne.decimate_surface

mne.decimate_surface(points, triangles, n_triangles, method='quadric', verbose=None)[source]

Decimate surface data.

Parameters
pointsndarray

The surface to be decimated, a 3 x number of points array.

trianglesndarray

The surface to be decimated, a 3 x number of triangles array.

n_trianglesint

The desired number of triangles.

methodstr

Can be “quadric” or “sphere”. “sphere” will inflate the surface to a sphere using Freesurfer and downsample to an icosahedral or octahedral mesh.

New in version 0.20.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns
pointsndarray

The decimated points.

trianglesndarray

The decimated triangles.

Notes

“quadric” mode

This requires VTK. If an odd target number was requested, the 'decimation' algorithm used results in the next even number of triangles. For example a reduction request to 30001 triangles may result in 30000 triangles.

“sphere” mode

This requires Freesurfer to be installed and available in the environment. The destination number of triangles must be one of [20, 80, 320, 1280, 5120, 20480] for ico (0-5) downsampling or one of [8, 32, 128, 512, 2048, 8192, 32768] for oct (1-7) downsampling.

This mode is slower, but could be more suitable for decimating meshes for BEM creation (recommended n_triangles=5120) due to better topological property preservation.