Writes a diffusion gradient table to a plain text file with one
line per DWI volume, each line holding the four space-separated values
[ x y z b ]. This is the format that the -grad option of the MRtrix3
commands expects, and the format of the dw_scheme entry in the header of
a .mif image.
write.dti.grad(filepath, bvec, bval = NULL, layout = "volumes")NULL, invisibly. Called for the side effect of writing the file.
character string, path to the output file. Files ending in
.gz are gzip-compressed.
numeric matrix with 3 columns (one row per volume) or 3 rows (one
column per volume), the gradient directions. Alternatively a full gradient
table, i.e. a numeric matrix with 4 columns named or ordered 'x', 'y', 'z'
and 'b', as returned by
read.dti.grad. If a full table is given,
the bval parameter must be left at NULL.
numeric vector, the b-value of each volume, in s/mm^2. Ignored if
bvec is a full gradient table.
character string, one of 'volumes' or 'components'. volumes
(the default) writes one volume per line, which is the MRtrix layout, while
components writes the transposed variant with 4 lines.
Other dti functions:
read.dti.bval(),
read.dti.bvec(),
read.dti.grad(),
read.dti.gradients(),
write.dti.bval(),
write.dti.bvec()