Learn R Programming

freesurferformats (version 1.1.0)

validate.dti.gradients: Validate and normalize a diffusion MRI gradient table.

Description

Checks that a set of b-vectors and b-values is consistent, replaces missing values by b=0 volumes, and reports suspicious entries. This is the validation used by read.dti.gradients, but it can also be called directly on gradients from any other source.

Usage

validate.dti.gradients(bvec, bval, n_volumes = NULL)

Value

a named list with the entries bvec (numeric matrix with n rows and 3 columns, one row per volume) and bval (numeric vector of length n).

Arguments

bvec

character string (path to a b-vectors file), or a numeric matrix with one row per volume (or one column per volume) and 3 columns.

bval

character string (path to a b-values file), or a numeric vector with one value per volume. Can be NULL if bvec identifies both files.

n_volumes

scalar numeric or integer, the number of volumes in the DWI image that the gradients belong to, used to check that the table matches the image. Typically dim(volume$data)[4]. Set to NULL (the default) to skip this check.