inst/doc/freesurferformats_header.R

## ---- eval = FALSE------------------------------------------------------------
#      library("freesurferformats");
#      mgh_file = system.file("extdata", "brain.mgz", package = "freesurferformats", mustWork = TRUE);
#      brain = read.fs.mgh(mgh_file, with_header = TRUE);

## ---- eval = FALSE------------------------------------------------------------
#  mghheader.is.ras.valid(brain$header);

## ---- eval = FALSE------------------------------------------------------------
#  voxel = c(128, 128, 128);
#  vox2ras = mghheader.vox2ras(brain);
#  ras_coords = vox2ras %*% c(voxel, 1);  # the 1 is because we use homogeneous coordinates

## ---- eval = FALSE------------------------------------------------------------
#  mghheader.primary.slice.direction(brain);

## ---- eval = FALSE------------------------------------------------------------
#  mghheader.crs.orientation(brain);

## ---- eval = FALSE------------------------------------------------------------
#  mghheader.is.conformed(brain);

Try the freesurferformats package in your browser

Any scripts or data that you put into this service are public.

freesurferformats documentation built on Feb. 11, 2022, 5:06 p.m.