Learn R Programming

ciftiTools (version 0.3.1)

read_cifti_separate: Read a CIFTI file with optional resampling

Description

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.

Usage

read_cifti_separate(
  cifti_fname,
  surfL_fname = NULL,
  surfR_fname = NULL,
  brainstructures = c("left", "right"),
  resamp_res = NULL,
  mwall_values = c(NA, NaN),
  verbose = TRUE
)

Arguments

cifti_fname

File path of CIFTI-format data (ending in ".d*.nii").

surfL_fname

(Optional) File path of GIFTI surface geometry file representing the left cortex.

surfR_fname

(Optional) File path of GIFTI surface geometry file representing the right cortex.

brainstructures

Character vector indicating which brain structure(s) to obtain: "left" (left cortical surface), "right" (right cortical surface) and/or "subcortical" (subcortical and cerebellar gray matter). Can also be "all" (obtain all three brain structures). Default: c("left","right") (cortical surface only).

If a brain structure is indicated but does not exist, a warning will be raised and that brain structure will be skipped.

resamp_res

(Optional) Target resolution for resampling (number of cortical surface vertices per hemisphere). If NULL (default) or FALSE, do not perform resampling.

mwall_values

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.

verbose

Should occasional updates be printed? Default: TRUE.

Value

A "xifti" object. See is.xifti.

Connectome Workbench Requirement

This function uses a system wrapper for the 'wb_command' executable. The user must first download and install the Connectome Workbench, available from https://www.humanconnectome.org/software/get-connectome-workbench .

Details

The subcortical component (NIFTI) is not resampled.