3dcalc - AFNI’s calculator program
用法1:
3dcalc -a dsetA [-b dsetB…] \
-expr EXPRESSION \
[options]
例子:
计算三个afni文件的对应像素的均值,
3dcalc -a fred+tlrc -b ethel+tlrc -c lucy+tlrc \
-expr '(a+b+c)/3' -prefix subjects_mean
用法2:
可以对afni数据集中的sub-bricks对应的像素做代数运算
例子:
3dcalc -a 'func+orig[2]' -b 'func+orig[4]' -expr 'sqrt(a*b)'
用法3:
产生一个mask,小于某个阈值的像素值设置为0
3dcalc -a 'func+orig[0]' -expr 'ispositive(a-3.14159)' \
-prefix mask
用法4:
Create a compound mask from a statistical dataset, where 3 stimuli show activation
从三个脑区激活图(共同激活的部分)里产生一个混合的mask,
3dcalc -a 'func+orig[12]' -b 'func+orig[15]' -c 'func+orig[18]' \
-expr 'step(a-4.2)*step(b-2.9)*step(c-3.1)' \
-prefix compound_mask
用法5:showing all combinations of activations,展示所有各种组合脑区激活的区域;
and The output mask dataset labels voxel values as such
0 = none active 1 = A only active 2 = B only active
3 = A and B only 4 = C only active 5 = A and C only
6 = B and C only 7 = all A, B, and C active
3dcalc -a 'func+orig[12]' -b 'func+orig[15]' -c 'func+orig[18]' \
-expr 'step(a-4.2)+2*step(b-2.9)+4*step(c-3.1)' \
-prefix mask_8