compute_cohend: Computing Cohen's d from MRI images

Description Usage Arguments Details Value Examples

View source: R/compute_cohend.R

Description

Cohen's d computation for neuroimaging data

Usage

1
2
compute_cohend(imgs1, imgs2, mask = array(1, dim = dim(imgs1)[1:3]),
  figure = TRUE, col = bluered(200), breaks = c(-100:100)/100 * 2)

Arguments

imgs1

4d image of group 1

imgs2

4d image of group 2

mask

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

figure

(default=TRUE) draw image

col

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

breaks

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

Details

This function computes simple Cohen's d maps from neuroimaging data for group level analysis. The formula we use is

d=\frac{\bar{X}_1- \bar{X}_2}{s_{pooled}},

s_{pooled} is the pooled standard deviation in two groups.

Value

cohen.dmap: image array of Cohen's d.

Examples

1
2
3
4
5
6
7
8
9
library(neurorct)
img.dim=c(10,12,15)
n=10
treatment=array(rnorm(img.dim[1]*img.dim[2]*img.dim[3]*n),dim=c(img.dim,n))
treatment[3:5,3:5,3:5,]  <- 10+treatment[3:5,3:5,3:5,]
control=array(rnorm(img.dim[1]*img.dim[2]*img.dim[3]*n),dim=c(img.dim,n))
control[3:5,3:5,3:5,]  <- 12+control[3:5,3:5,3:5,]
mask=array(0,img.dim);mask[2:8,2:11,2:14]<-1
z=compute_cohend(imgs1=treatment,imgs2=control,mask=mask)

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