compute_r: Computing Cohen's d from MRI images

Description Usage Arguments Details Value Examples

View source: R/compute_r.R

Description

Pearson's r computation for neuroimaging data

Usage

1
2
3
compute_r(imgs, x, mask = array(1, dim = dim(imgs)[1:3]),
  col = bluered(200), breaks = c(-100:100)/100, method = "pearson",
  adjust = FALSE)

Arguments

imgs

4d images

x

independent variables

mask

Mask file (default=array(1,dim=dim(imgs1)[1:3]))

col

(only if figure=TRUE, default=bluered(200))

breaks

(only if figure=TRUE, default=c(-100:100)/100*7)

method

(default='pearson') 'spearman', 'tau' can be used.

adjust

(default=FALSE) compute adjusted r ()

Details

This function computes voxel-wise pearson's correlation coefficients between an independent variable and neuroimaging data.

Value

rmap: image array of pearson's coefficients.

Examples

1
2
3
4
5
6
7
8
library(neurorct)
img.dim=c(10,12,15)
n=100
x=rnorm(n)
img=array(rnorm(img.dim[1]*img.dim[2]*img.dim[3]*n),dim=c(img.dim,n))
img[3:5,3:5,3:5,]  <- array(rep(x,each=27),c(3,3,3,n)) +img[3:5,3:5,3:5,]
mask=array(0,img.dim);mask[2:8,2:11,2:14]<-1
z=compute_r(imgs=img,x=x,mask=mask)

seonjoo/neurorct documentation built on May 7, 2020, 3:18 a.m.