Convert CIFTI, NIFTI, or GIFTI input to a \(T \times V\) matrix by
reading it in with the corresponding package and then separating the data
from the metadata. Also works with the intermediate R objects created from
reading these files: "xifti" objects from ciftiTools,
"gifti" objects from gifti,
"nifti" or "niftiExtension" objects from oro.nifti, and
"niftiImage" objects from RNifti.
For CIFTI files, only intents supported by ciftiTools are supported:
dscalar, dtseries, and dlabel. For NIFTI file or
NIFTI-intermediate R objects, the data will be vectorized/masked.
as.matrix_ifti(
x,
meta = FALSE,
sortSub = FALSE,
TbyV = TRUE,
verbose = FALSE,
...
)If !meta, x as a matrix. If meta, a list of
length two: the first entry is x as a matrix, and the second entry is
the metadata of x.
The object to coerce to a matrix
Return metadata too? Default: FALSE.
For CIFTI format input only. Sort subcortex by labels?
Default: FALSE (sort by array index).
Return the data matrix in \(T \times V\) form? Default:
TRUE. If FALSE, return in \(V \times T\) form instead.
Using this argument may be faster than transposing after the function call.
Print updates? Default: FALSE.
If x is a file path, additional arguments to the function
used to read in x can be specified here. For example, if x
is a path to a CIFTI file, ... might specify which idx and
brainstructures to read in.