Read a CIFTI file by exporting it as a single GIFTI
using -cifti-convert -to-gifti-ext
(read_cifti_flat
),
and obtaining the brainordinate mapping using
-cifti-export-dense-mapping
(info_cifti
).
read_cifti_convert(
cifti_fname,
surfL_fname = NULL,
surfR_fname = NULL,
brainstructures = "existing",
idx = NULL,
mwall_values = c(NA, NaN),
verbose = FALSE,
...
)
A "xifti"
object. See is.xifti
.
File path to a CIFTI file (ending in ".d*.nii").
(Optional) File path to a GIFTI surface geometry file representing the left cortex.
(Optional) File path to a GIFTI surface geometry file representing the right cortex.
Character vector indicating which brain structure(s)
to read in: "left"
(left cortex), "right"
(right cortex)
and/or "subcortical"
(subcortex and cerebellum). Can also be
"all"
(read all three brain structures), or "existing"
(read all brain structures in the file). Default: "existing"
.
If a brain structure is indicated but does not exist, a warning will be raised and that brain structure will be skipped.
Numeric vector indicating the data indices (columns) to read. If
NULL
(default), read in all the data. Must be a subset of the indices
present in the file, or an error will occur.
For high-resolution CIFTI files, reading in only a subset of the data saves memory, but will be slower than reading in the entire file due to the required intermediate steps.
If the medial wall mask is not present in the CIFTI,
infer it from these data values. Default: c(NA, NaN)
. If NULL
,
do not attempt to infer the medial wall mask from the data values.
Should occasional updates be printed? Default: FALSE
.
Additional arguments to read_cifti_flat
.