Learn R Programming

nifti.pbcor (version 1.0)

nifti.pbcor_mask: Prepare the mask for a parcel-based correlation between NIfTI images

Description

This function creates the mask required to conduct parcel-based correlations with nifti.pbcor.

Usage

nifti.pbcor_mask(nifti, verbose = TRUE)

Value

A matrix with the coordinates of the mask

Arguments

nifti

an object of class "nifti" with 3D (e.g., the brain mask).

verbose

(optional) logical, whether to print some messages during execution.

Author

Joaquim Radua

Details

This function converts a NIfTI mask into the appropriate format for nifti.pbcor.

See Also

nifti.pbcor, readNIfTI

Examples

Run this code
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)

Run the code above in your browser using DataLab