read.fs.morph: Read morphometry data file in any FreeSurfer format.

View source: R/read_fs_curv.R

read.fs.morphR Documentation

Read morphometry data file in any FreeSurfer format.

Description

Read vertex-wise brain surface data from a file. The file can be in any of the supported formats, and the format will be determined from the file extension.

Usage

read.fs.morph(filepath, format = "auto")

Arguments

filepath

string. Full path to the input file. The suffix determines the expected format as follows: ".mgz" and ".mgh" will be read with the read.fs.mgh function, all other file extensions will be read with the read.fs.curv function.

format

character string, the format to use. One of c("auto", "mgh", "mgz", "curv", "gii"). The default setting "auto" will determine the format from the file extension.

Value

data, vector of floats. The brain morphometry data, one value per vertex.

See Also

Other morphometry functions: fs.get.morph.file.ext.for.format(), fs.get.morph.file.format.from.filename(), read.fs.curv(), read.fs.mgh(), read.fs.morph.gii(), read.fs.volume(), read.fs.weight(), write.fs.curv(), write.fs.label.gii(), write.fs.mgh(), write.fs.morph.asc(), write.fs.morph.gii(), write.fs.morph.ni1(), write.fs.morph.ni2(), write.fs.morph.smp(), write.fs.morph.txt(), write.fs.morph(), write.fs.weight.asc(), write.fs.weight()

Examples

    curvfile = system.file("extdata", "lh.thickness",
                            package = "freesurferformats", mustWork = TRUE);
    ct = read.fs.morph(curvfile);
    cat(sprintf("Read data for %d vertices. Values: min=%f, mean=%f, max=%f.\n",
                            length(ct), min(ct), mean(ct), max(ct)));


    mghfile = system.file("extdata", "lh.curv.fwhm10.fsaverage.mgz",
                            package = "freesurferformats", mustWork = TRUE);
    curv = read.fs.morph(mghfile);
    cat(sprintf("Read data for %d vertices. Values: min=%f, mean=%f, max=%f.\n",
                            length(ct), min(ct), mean(ct), max(ct)));


freesurferformats documentation built on May 29, 2024, 5:29 a.m.