nifti.pbcor {nifti.pbcor} | R Documentation |
Calculates the correlation between two NIfTI objects (e.g., brain maps) across random parcels.
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)
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. |
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.
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.
Joaquim Radua
Fortea et al., under review.
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)