nifti.pbcor {nifti.pbcor} | R Documentation |
Parcel-based correlation between two NIfTI objects
Description
Calculates the correlation between two NIfTI objects (e.g., brain maps) across random parcels.
Usage
nifti.pbcor(nifti1, nifti2, mask_coords, n.parcels = 90, n.parcellations = 50,
kmeans.iter.max = 30, kmeans.nstart = 1,
kmeans.algorithm = "Hartigan-Wong", kmeans.trace = FALSE,
cor.alternative = "two.sided", cor.method = "pearson",
cor.exact = NULL, cor.conf.level = 0.95, cor.continuity = FALSE,
verbose = TRUE)
Arguments
nifti1 |
an object of class |
nifti2 |
an object of class |
mask_coords |
a mask matrix prepared by nifti.pbcor_mask. |
n.parcels |
the number of parcels to divide the mask into. The default is 90, approximately the minimum number of resels in the meta-analytic maps of gray matter differences between individuals with mental disorders and healthy controls in Fortea et al. (see below). |
n.parcellations |
the number of parcellations, i.e., how many times the mask will be parcellated. |
kmeans.iter.max |
(optional) argument |
kmeans.nstart |
(optional) argument |
kmeans.algorithm |
(optional) argument |
kmeans.trace |
(optional) argument |
cor.alternative |
(optional) argument |
cor.method |
(optional) argument |
cor.exact |
(optional) argument |
cor.conf.level |
(optional) argument |
cor.continuity |
(optional) argument |
verbose |
(optional) logical, whether to print some messages during execution. |
Details
This approach resolves the problems of voxel-based correlations, where contiguous voxels are non-independent, by randomly segmenting the mask (e.g., the brain) into parcels and calculating the Pearson correlation coefficient across these parcels. Additionally, it circumvents the limitations of atlas-based correlations, where estimates depend on the specific atlas used, by repeating the random parcellation and correlation multiple times and selecting the median estimate.
Value
The parcel-based correlation between the two images across parcellations. The attribute "parcellations.cor.test" has the cor.test
results obtained in the different random parcellations.
Author(s)
Joaquim Radua
References
Fortea et al., under review.
See Also
Examples
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)