enigmatoolbox.mesh.mesh_io.write_surface(ifilter, opth, oformat=None, otype=None)[source]

Write surface data (author: @OualidBenkarim)

See otype for supported file types.

  • ifilter (BSAlgorithm or BSDataObject) – Input filter or data.

  • opth (str) – Output filename.

  • oformat ({'ascii', 'binary'}, optional) – File format. Defaults to writer’s default format. Only used when writer accepts format. Default is None.

  • otype ({'ply', 'vtp', 'vtk', 'fs', 'asc', 'gii'}, optional) – File type. If None, type is deduced from opth. Default is None.


Function can save data in FreeSurfer binary (‘fs’) and ascii (‘asc’) format. Gifti surfaces can also be saved if nibabel is installed.

See also