mne.write_surface

mne.write_surface(fname, coords, faces, create_stamp='', volume_info=None, overwrite=False)[source]

Write a triangular Freesurfer surface mesh.

Accepts the same data format as is returned by read_surface().

Parameters
fnamestr

File to write.

coordsarray, shape=(n_vertices, 3)

Coordinate points.

facesint array, shape=(n_faces, 3)

Triangulation (each line contains indices for three points which together form a face).

create_stampstr

Comment that is written to the beginning of the file. Can not contain line breaks.

volume_infodict-like or None

Key-value pairs to encode at the end of the file. Valid keys:

  • ‘head’ : array of int

  • ‘valid’ : str

  • ‘filename’ : str

  • ‘volume’ : array of int, shape (3,)

  • ‘voxelsize’ : array of float, shape (3,)

  • ‘xras’ : array of float, shape (3,)

  • ‘yras’ : array of float, shape (3,)

  • ‘zras’ : array of float, shape (3,)

  • ‘cras’ : array of float, shape (3,)

New in version 0.13.0.

overwritebool

If True, overwrite the file if it exists.