resample_cifti_components: Resample a series of GIFTIs related to a CIFTI file

View source: R/resample_cifti_components.R

resample_cifti_componentsR Documentation

Resample a series of GIFTIs related to a CIFTI file

Description

Performs spatial resampling of various CIFTI file components on the cortical surface. (The subcortical data is not resampled here.) GIFTI surface geometry files can additionally be included: see surfL_original_fname and surfR_original_fname.

Usage

resample_cifti_components(
  original_res = NULL,
  resamp_res = NULL,
  resamp_method = NULL,
  areaL_original_fname = NULL,
  areaR_original_fname = NULL,
  areaL_target_fname = NULL,
  areaR_target_fname = NULL,
  cortexL_original_fname = NULL,
  cortexR_original_fname = NULL,
  cortexL_target_fname = NULL,
  cortexR_target_fname = NULL,
  ROIcortexL_original_fname = NULL,
  ROIcortexR_original_fname = NULL,
  ROIcortexL_target_fname = NULL,
  ROIcortexR_target_fname = NULL,
  sphereL_original_fname = NULL,
  sphereR_original_fname = NULL,
  sphereL_target_fname = NULL,
  sphereR_target_fname = NULL,
  surfL_original_fname = NULL,
  surfR_original_fname = NULL,
  surfL_target_fname = NULL,
  surfR_target_fname = NULL,
  read_dir = NULL,
  write_dir = NULL
)

Arguments

original_res

The original resolution(s) of the CIFTI cortical surface(s).

resamp_res

Target resolution for resampling (number of cortical surface vertices per hemisphere).

resamp_method

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

While adaptive resampling is recommended for metric or label data, it requires that area[L/R]_original_fname be provided.

Note that surfaces will resampled using barycentric resampling regardless of resamp_method, because barycentric resampling rather than adaptive resampling is recommended for surface data.

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.

cortexL_original_fname, cortexR_original_fname

(Optional) File path of GIFTI data for [left/right] cortex to resample.

cortexL_target_fname, cortexR_target_fname

(Optional) File path to save the resampled GIFTI data for [left/right] cortex as. If NULL (default) and cortex[L/R]_original_fname was provided, it will be named by cifti_component_suffix.

ROIcortexL_original_fname, ROIcortexR_original_fname

(Optional) File path of GIFTI ROI corresponding to cortex[L/R]_original_fname to resample.

ROIcortexL_target_fname, ROIcortexR_target_fname

(Optional) File path of to save the resampled GIFTI ROI corresponding to cortex[L/R]_target_fname as. If NULL (default) and cortex[L/R]_original_fname was provided, it will be named by cifti_component_suffix.

surfL_original_fname

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

surfR_original_fname

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

surfL_target_fname

(Optional) Where to save the resampled GIFTI surface geometry file representing the left cortex.

surfR_target_fname

(Optional) Where to save the resampled GIFTI surface geometry file representing the right cortex.

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.

Details

Step 1: Generate spheres in the original and target resolutions Step 2: Use -metric-resample to resample surface/cortex files Step 3: Use -surface-resample to resample gifti files

Value

A named character vector of file paths to each resampled file


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