read_nisurfacefile: S3 method to read a neuroimaging surface file.
Description
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.
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.
Arguments
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 read_nisurface.<method>, which must return an `fs.surface` instance on success.