SPM imcalc for standardized effect size

Cohen’s d is mean/stdev.

This is an easy calculation in imcalc - select the mean and the stdev images, so

i1 = mean

i2 = stdev

The basic formula would be just

i1./i2

However, that causes an error with stdev of 0, so use this formula to set effect size to 0 where stdev is 0:

i1./(i2.*(i2>0) +999999.*(i2<=0))

Strictly speaking, it’s not 0, just 1/999,999.

Note: keep the dots (“.”) in those formulas. Otherwise, matlab tries to do matrix math.