Reads the diffusion gradient directions of a diffusion MRI dataset, i.e. the b-vectors part of the FSL bvecs/bvals format. The file contains unit vectors (or zero vectors for the b=0 volumes), stored as three rows of n values, one row per component, one column per volume.
Arguments
- filepath
character string, path to the b-vectors file, typically ending in
.bvecor.bvecs, but without an extension in the HCP layout.- layout
character string, one of 'auto', 'components' or 'volumes'.
componentsmeans that there are 3 lines, one per vector component (the FSL layout, and what the file namebvecsimplies),volumesmeans one volume per line, i.e. n lines with 3 values each (the HCP layout). With 'auto' (the default), the layout is derived from the matrix dimensions and a warning is raised for a square table, which is ambiguous.
Value
a numeric matrix with n rows and 3 columns, one row per volume, the
columns being the x, y and z component of the gradient direction. Note that
these vectors are given with respect to the image axes, not to the
scanner axes, so they are only meaningful together with the image they
belong to: converting them to scanner space requires the transform of that
image. Use read.dti.gradients to read
b-vectors and b-values together, with consistency checks.
Note
The b-vectors are returned exactly as they are stored, i.e. they are
not renormalized, and missing values (see
read.dti.gradients) are not replaced here.
See also
Other dti functions:
read.dti.bval(),
read.dti.grad(),
read.dti.gradients(),
write.dti.bval(),
write.dti.bvec(),
write.dti.grad()