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
.
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
)
A named character vector of file paths to each resampled file
The original resolution(s) of the CIFTI cortical surface(s).
Target resolution for resampling (number of cortical surface vertices per hemisphere).
"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.
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.
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.
(Optional) File path of GIFTI data for [left/right] cortex to resample.
(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
.
(Optional) File
path of GIFTI ROI corresponding to cortex[L/R]_original_fname
to
resample.
(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
.
(Optional) File path to a GIFTI surface geometry file representing the left cortex.
(Optional) File path to a GIFTI surface geometry file representing the right cortex.
(Optional) Where to save the resampled GIFTI surface geometry file representing the left cortex.
(Optional) Where to save the resampled GIFTI surface geometry file representing the right cortex.
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.
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.
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