Learn R Programming

ciftiTools (version 0.9.0)

write_xifti2: Write a "xifti" object to GIFTI and NIFTI files

Description

Write metric or label GIFTIs for the cortical surface data and NIFTIs for the subcortical labels and mask in a "xifti" object. Each present brainstructure will be written; if a brainstructure is absent the corresponding file is not written.

Usage

write_xifti2(
  xifti,
  brainstructures = NULL,
  cortexL_fname = NULL,
  cortexR_fname = NULL,
  subcortVol_fname = NULL,
  subcortLabs_fname = NULL,
  ROI_brainstructures = "all",
  ROIcortexL_fname = NULL,
  ROIcortexR_fname = NULL,
  ROIsubcortVol_fname = NULL,
  write_dir = NULL,
  verbose = FALSE
)

Arguments

xifti

A "xifti" object.

brainstructures

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.

cortexL_fname

(Optional) GIFTI file names (*.[func/label].gii) to save the [left/right] cortex data to. If not provided, defaults to "*[L/R].\[func/label\].gii", where * is the file name component of cifti_fname. Will be written in write_dir.

dtseries and dscalar files should use "func", whereas dlabel files should use "label".

cortexR_fname

(Optional) GIFTI file names (*.[func/label].gii) to save the [left/right] cortex data to. If not provided, defaults to "*[L/R].\[func/label\].gii", where * is the file name component of cifti_fname. Will be written in write_dir.

dtseries and dscalar files should use "func", whereas dlabel files should use "label".

subcortVol_fname

(Optional) NIFTI file names to save the subcortical [volume/labels] to. If not provided, defaults to "*[/.labels].nii", where * is the file name component of cifti_fname. Will be written in write_dir.

subcortLabs_fname

(Optional) NIFTI file names to save the subcortical [volume/labels] to. If not provided, defaults to "*[/.labels].nii", where * is the file name component of cifti_fname. Will be written in write_dir.

ROI_brainstructures

Which ROIs should be obtained? "all" (default) to obtain ROIs for each of the brainstructures. NULL to not obtain any ROIs. This should be a subset of brainstructures.

ROIcortexL_fname

(Optional) GIFTI file names (*.[func/label].gii) to save the [left/right] cortex ROI to. If not provided, defaults to "*ROI_[L/R].\[func/label\].gii", where * is the file name component of cifti_fname. The cortical ROIs typically represent the medial wall mask, with values of 1 for in-ROI (non-medial wall) vertices and 0 for out-of-ROI (medial wall) vertices. Will be written in write_dir.

dtseries and dscalar files should use "func", whereas dlabel files should use "label".

ROIcortexR_fname

(Optional) GIFTI file names (*.[func/label].gii) to save the [left/right] cortex ROI to. If not provided, defaults to "*ROI_[L/R].\[func/label\].gii", where * is the file name component of cifti_fname. The cortical ROIs typically represent the medial wall mask, with values of 1 for in-ROI (non-medial wall) vertices and 0 for out-of-ROI (medial wall) vertices. Will be written in write_dir.

dtseries and dscalar files should use "func", whereas dlabel files should use "label".

ROIsubcortVol_fname

(Optional) NIFTI file names to save the subcortical ROI to. If not provided, defaults to "*ROI.nii", where * is the file name component of cifti_fname. The subcortical ROI typically represents the volumetric mask for the entire subcortical structure, with values of 1 for in-ROI (in subcortex) voxels and 0 for out-of-ROI (not in subcortex) voxels. Will be written in write_dir.

write_dir

Where should the separated files be placed? NULL (default) will write them to the current working directory.

write_dir must already exist, or an error will occur.

verbose

Should occasional updates be printed? Default: FALSE.

Value

List of written files