Read a CIFTI file by writing each component into a GIFTI and NIFTI file
(separate_cifti
), optionally resampling the GIFTIs,
(resample_gifti
), and then reading each separated
component into R (make_xifti
). Surfaces can also be provided;
they will be resampled along with the CIFTI for viewing.
read_cifti_separate(
cifti_fname,
surfL_fname = NULL,
surfR_fname = NULL,
brainstructures = c("left", "right"),
idx = NULL,
resamp_res = NULL,
mwall_values = c(NA, NaN),
verbose = TRUE
)
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 obtain: "left"
(left cortex), "right"
(right cortex)
and/or "subcortical"
(subcortex and cerebellum). Can also be
"all"
(obtain all three brain structures). Default:
c("left","right")
(cortex only).
If a brain structure is indicated but does not exist in the CIFTI file, a warning will occur 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.
(Optional) Target resolution for resampling (number of
cortical surface vertices per hemisphere). If NULL
(default) or
FALSE
, do not perform resampling.
If the medial wall locations are not indicated in the
CIFTI, use these values to infer the medial wall mask. Default:
c(NA, NaN)
. If NULL
, do not attempt to infer the medial wall.
Should occasional updates be printed? Default: TRUE
.
A "xifti"
object. See is.xifti
.
The subcortical component (NIFTI) is not resampled.