Tries to read the file with all implemented surface format reader methods. The file must exist. With the default settings, one can read files in the following surface formats: 1) FreeSurfer binary surface format (e.g., `surf/lh.white`). 2) FreeSurfer ASCII surface format (e.g., `surf/lh.white,asc`). 3) GIFTI surface format, only if package `gifti` is installed. See gifti::read_gifti
for details. Feel free to implement additional methods. Hint:keep in mind that they should return one-based indices.
read_nisurfacefile(filepath, methods = c("fsnative", "fsascii", "gifti"), ...)
filepath | character string, the full path to the input surface file. |
---|---|
methods | list of character strings, the formats to try. Each of these must have a function called |
... | parameters passed on to the individual methods |
an instance of `fs.surface`, read from the file. See read.fs.surface
for details. If none of the reader methods succeed, an error is raised.
Other mesh functions:
faces.quad.to.tris()
,
read.fs.surface.asc()
,
read.fs.surface.bvsrf()
,
read.fs.surface.geo()
,
read.fs.surface.gii()
,
read.fs.surface.ico()
,
read.fs.surface.obj()
,
read.fs.surface.off()
,
read.fs.surface.ply()
,
read.fs.surface.vtk()
,
read.fs.surface()
,
read.mesh.brainvoyager()
,
read_nisurface()
,
write.fs.surface.asc()
,
write.fs.surface.byu()
,
write.fs.surface.gii()
,
write.fs.surface.mz3()
,
write.fs.surface.vtk()
,
write.fs.surface()
surface_file = system.file("extdata", "lh.tinysurface",
package = "freesurferformats", mustWork = TRUE);
mesh = read_nisurface(surface_file);
mesh;
#> Brain surface trimesh with 5 vertices and 3 faces.
#> -Surface coordinates: minimal values are (0.30, 0.30, 0.30), maximal values are (0.30, 0.30, 0.30).