remap_cifti_wrapper: 'remap_cifti' wrapper

View source: R/remap_cifti.R

remap_cifti_wrapperR Documentation

remap_cifti wrapper

Description

Wrapper for remap_cifti. Calls resample_cifti_components using the original file names listed in the original_fnames argument and the target file names listed in the remap_fnames argument.

Usage

remap_cifti_wrapper(
  original_fnames,
  remap_fnames = NULL,
  remap_method = c("adaptive", "barycentric"),
  areaL_original_fname = NULL,
  areaR_original_fname = NULL,
  areaL_target_fname = NULL,
  areaR_target_fname = NULL,
  sphereL_original_fname = NULL,
  sphereR_original_fname = NULL,
  sphereL_target_fname = NULL,
  sphereR_target_fname = NULL,
  read_dir = NULL,
  write_dir = NULL
)

Arguments

original_fnames

The files to remap. This is a named list where each element's name is a file type label, and each element's value is a file name. Labels must be one of the following: "cortexL", "cortexR", "ROIcortexL", "ROIcortexR". If read_dir is not NULL, then all these file names should be relative to read_dir.

remap_fnames

Where to write the resampled files. This is a named list where each entry's name is a file type label, and each entry's value is a file name indicating where to write the corresponding resampled file. The recognized file type labels are: "cortexL", "cortexR", "ROIcortexL", "ROIcortexR", "validROIcortexL", and "validROIcortexR".

Entry values can be NULL, in which case a default file name will be used: see resample_cifti_default_fname. Default file names will also be used for files that need to be resampled/written but without a corresponding entry in remap_fnames.

Entries in remap_fnames will be ignored if they are not needed based on [ROI_]brainstructures. For example, if brainstructures="left", then remap_fnames$cortexR will be ignored if specified.

The write_dir argument can be used to place each resampled file in the same directory.

remap_method

"adaptive" (default) or "adaptive" resampling. These options correspond to the Workbench command options "BARYCENTRIC" and "ADAP_BARY_AREA", respectively.

For remapping between fs_LR group data and FreeSurfer fsaverage group data, adaptive resampling should be used.

areaL_original_fname, areaR_original_fname

File paths to the surfaces to use for vertex area correction during adaptive resampling. (Only used if resampling with the adaptive method.) area[L/R]_original_fname should match the current resolution of the data.

For resampling: the Workbench command for adaptive resampling requires the target surfaces for area correction too. But to make the workflow easier, ciftiTools will resample area[L/R]_original_fname with the barycentric method and use that for the target area.

For remapping: area[L/R]_target_fname must be directly provided.

areaL_target_fname, areaR_target_fname

File paths to the surfaces to use for vertex area correction during adaptive resampling. (Only used if resampling with the adaptive method.) area[L/R]_target_fname should match the target resolution of the data.

read_dir

Directory to append to the path of every file being read, e.g. cortexL_original_fname. If NULL (default), do not append any directory to the path.

read_dir must already exist, or an error will be raised.

write_dir

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

write_dir must already exist, or an error will occur.

Value

The return value of the resample_cifti_components call


mandymejia/ciftiTools documentation built on Feb. 28, 2024, 11:20 a.m.