Learn R Programming

freesurferformats (version 1.1.0)

write.dti.bvec: Write b-vectors to a FSL-style bvecs file.

Description

Writes the diffusion gradient directions of a diffusion MRI dataset to a plain text file, which is the bvecs part of the FSL bvecs/bvals format. Note that these vectors are interpreted relative to the image axes, so the file is only meaningful together with the image it was derived from.

Usage

write.dti.bvec(filepath, bvec, layout = "components")

Value

NULL, invisibly. Called for the side effect of writing the file.

Arguments

filepath

character string, path to the output file. The conventional extension is .bvec or .bvecs, but that is not enforced. Files ending in .gz are gzip-compressed.

bvec

numeric matrix with 3 columns (one row per volume) or 3 rows (one column per volume), the gradient direction of each volume.

layout

character string, one of 'components' or 'volumes'. components (the default) writes the file with 3 lines, one per vector component, which is the FSL layout, while volumes writes one volume per line, which is what the Human Connectome Project distributes.

See Also

Other dti functions: read.dti.bval(), read.dti.bvec(), read.dti.grad(), read.dti.gradients(), write.dti.bval(), write.dti.grad()