Write a triangular Freesurfer surface mesh.
Accepts the same data format as is returned by read_surface().
str
File to write.
array
, shape=(n_vertices, 3)Coordinate points.
int
array
, shape=(n_faces, 3)Triangulation (each line contains indices for three points which together form a face).
str
Comment that is written to the beginning of the file. Can not contain line breaks.
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.
File format to use. Can be ‘freesurfer’ to write a FreeSurfer surface file, or ‘obj’ to write a Wavefront .obj file (common format for importing in other software), or ‘auto’ to attempt to infer from the file name. Defaults to ‘auto’.
New in version 0.21.0.
If True (default False), overwrite the destination file if it exists.
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.
See also
mne.write_surface
#