Ð68Ð
Script for Deconvolution - 3
#===============================================================
# create masks for each run using 3dAutomask
#===============================================================

foreach run ( `count -digits 1 1 10` )
    3dAutomask -prefix mask_r{$run} {$subj}_r{$run}_vr_bl+orig
end

#===============================================================
# create a mask enveloping masks of the individual runs
#===============================================================
   
3dcalc -a mask_r1+orig -b mask_r2+orig -c mask_r3+orig    \
       -d mask_r4+orig -e mask_r5+orig -f mask_r6+orig    \
       -g mask_r7+orig -h mask_r8+orig -i mask_r9+orig    \
       -j mask_r10+orig                                   \
       -expr 'step(a+b+c+d+e+f+g+h+i+j)'                  \
       -prefix full_mask

Loop over imaging runs 1..10
This mask dataset will be 1 inside the largest contiguous high intensity EPI region, and 0 outside that region Ñ this makes a brain mask