Learn R Programming

ciftiTools (version 0.9.0)

resample_cifti: Resample CIFTI data

Description

Performs spatial resampling of CIFTI data on the cortical surface by separating it into GIFTI and NIFTI files, resampling the GIFTIs, and then putting them together. (The subcortex is not resampled.)

Usage

resample_cifti(
  x = NULL,
  cifti_target_fname = NULL,
  surfL_original_fname = NULL,
  surfR_original_fname = NULL,
  surfL_target_fname = NULL,
  surfR_target_fname = NULL,
  resamp_res,
  write_dir = NULL,
  mwall_values = c(NA, NaN),
  verbose = TRUE
)

resampleCIfTI( x = NULL, cifti_target_fname = NULL, surfL_original_fname = NULL, surfR_original_fname = NULL, surfL_target_fname = NULL, surfR_target_fname = NULL, resamp_res, write_dir = NULL, mwall_values = c(NA, NaN), verbose = TRUE )

resamplecii( x = NULL, cifti_target_fname = NULL, surfL_original_fname = NULL, surfR_original_fname = NULL, surfL_target_fname = NULL, surfR_target_fname = NULL, resamp_res, write_dir = NULL, mwall_values = c(NA, NaN), verbose = TRUE )

resample_xifti( x = NULL, cifti_target_fname = NULL, surfL_original_fname = NULL, surfR_original_fname = NULL, surfL_target_fname = NULL, surfR_target_fname = NULL, resamp_res, write_dir = NULL, mwall_values = c(NA, NaN), verbose = TRUE )

Arguments

x

The CIFTI file name or "xifti" object to resample. If NULL, the result will be a "xifti" with resampled surfaces given by surfL_original_fname and surfR_original_fname.

cifti_target_fname

File name for the resampled CIFTI. Will be placed in write_dir. If NULL, will be written to "resampled.d*.nii". write_dir will be appended to the beginning of the path.

surfL_original_fname, surfR_original_fname

(Optional) Path to a GIFTI surface geometry file representing the left/right cortex. One or both can be provided. These will be resampled too, and are convenient for visualizing the resampled data.

If x is a "xifti" object with surfaces, these arguments will override the surfaces in the "xifti".

surfL_target_fname, surfR_target_fname

(Optional) File names for the resampled GIFTI surface geometry files. Will be placed in write_dir. If NULL (default), will use default names created by resample_cifti_default_fname.

resamp_res

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

write_dir

Where to write the resampled CIFTI (and surfaces if present.) If NULL (default), will use the current working directory if x was a CIFTI file, and a temporary directory if x was a "xifti" object.

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.

Correctly indicating the medial wall locations is important for resampling, because the medial wall mask is taken into account during resampling calculations.

verbose

Should occasional updates be printed? Default: TRUE.

Value

A named character vector of written files: "cifti" and potentially "surfL" (if surfL_original_fname was provided) and/or "surfR" (if surfR_original_fname was provided).

Connectome Workbench

This function interfaces with the "-metric-resample", "-label-resample", and/or "-surface-resample" Workbench commands, depending on the input.

Details

Can accept a "xifti" object as well as a path to a CIFTI-file.

See Also

Other commonly-used functions: is.cifti(), read_cifti(), smooth_cifti(), view_xifti_surface(), view_xifti_volume(), write_cifti()