In this document, we show how to read brain imaging data from FreeSurfer binary files. These files are created and used by the FreeSurfer neuroimaging software suite to store volume data and surface morphometry data computed from MRI brain images.
Brain imaging data come in different formats. Typically, the data is acquired on a scanner that outputs a set of two-dimensional (2D) DICOM format images. The DICOM images are often combined into a single file that holds a 3D or 4D stack of images for further processing. Common formats include ANALYZE, NIFTI, and the MGH format used by FreeSurfer. This freesurferdata R package implements functions to parse data in MGH format, as well as some related FreeSurfer formats.
Let’s read an example morphometry data file that comes with this package. It contains vertex-wise measures of cortical thickness for the left hemisphere of a single subject in native space.
library("freesurferformats")
curvfile = system.file("extdata", "lh.thickness", package = "freesurferformats", mustWork = TRUE)
ct = read.fs.curv(curvfile)
We can now have a closer look at the data and maybe plot a histogram:
## Read data for 149244 vertices. Values: min=0.000000, mean=2.437466, max=5.000000.