nifti.pbcor_mask {nifti.pbcor} | R Documentation |
This function creates the mask required to conduct parcel-based correlations with nifti.pbcor
.
nifti.pbcor_mask(nifti, verbose = TRUE)
nifti |
an object of class |
verbose |
(optional) logical, whether to print some messages during execution. |
This function converts a NIfTI mask into the appropriate format for nifti.pbcor
.
A matrix with the coordinates of the mask
Joaquim Radua
library(oro.nifti)
# Path of the example files (with large voxels to ensure the example runs quickly)
mask_path = system.file("examples", "mask.nii.gz", package = "nifti.pbcor")
img1_path = system.file("examples", "img1.nii.gz", package = "nifti.pbcor")
img2_path = system.file("examples", "img2.nii.gz", package = "nifti.pbcor")
# Prepare the mask
mask = nifti.pbcor_mask(readNIfTI(mask_path))
# Conduct the parcel-based correlation
nifti.pbcor(readNIfTI(img1_path), readNIfTI(img2_path), mask)