In a group analysis, we are interested some functional brain activity that is common to a group of subjects. For example, we may be interested in questions like, What brain areas are activated by the task? Of course there will be many individual differences between subjects, but here we're going to average across subjects and only look at what they have in common.
In order to average across subjects, we need some common ground. First off, we'll do everything in Talairach space. That is, each subject's structural and functional images will be warped into a common coordinate system. Talairach isn't the only one, but it's the easiest to do with AFNI.
First, use AFNI to Talairach the orthogonalized (or ortho) brain image. The reason for using the ortho image is that SAM computes its results in that coordinate system, and AFNI will allow us to warp the .svl file result of SAM into Talairach space, if it knows the ortho → Talairach transform. The rest of this page will assume that you have a Talairached AFNI BRIK for each of your subjects.
In addition to the structural normalization mentioned above, you may wish to do some functional normalization as well. Again, there will probably be many interesting individual differences between subjects, but here we're interested in what they have in common. For example, in a typical dual-state comparison of power levels, some subjects may show a very large power increase or decrease between the active and control states, while other subjects may show only small changes. If we're more interested in the locations of the power changes, and not so much in their amplitudes, we can normalize all the subjects' .svl files to have a common amplitude scale. This will also prevent outlier subjects from dominating the average.
3dNormalize $ds/SAM/<name>.svl name
3dNormalize reads the .svl file and scales the values to have a standard deviation of 1, producing an AFNI BRIK (here called name). With the -z option, it will also remove the mean, producing z-scores. Often, dual-state SAM images such as D3 (pseudo-F) images have roughly normal distributions centered near zero, so -z isn't needed. You can check this with 3dhistog. If you have more samples in one or the other state, however, you may need to use the -z option to counteract the effects of a state imbalance.
AFNI's adwarp program can transform the functional image (normalized or not) into the Talairach coordinate system, given the ortho+tlrc BRIK.
adwarp -apar ortho+tlrc -dpar name+orig -dxyz 7
Here, ortho+tlrc is the subject's Talairach-warped structural BRIK, name+orig is the output of 3dNormalize (you could also just use the plain .svl file here), the output will be called name+tlrc, and the other important option is -dxyz, which specifies the resolution of the output BRIK in mm. It should be the same as the resolution of the SAM volume. That is, when you ran SAMsrc, if you used a value of .7 for the -s option (which takes cm), then you should use a value of 7 here.
If you used the @auto_tlrc script, the command is:
@auto_tlrc -apar ortho_at+tlrc -input name+orig -dxyz 7
At this point, you can use 3dMean to average several subjects' normalized, warped images together. The result can be overlaid on either an individual Talairach image, or you can also use 3dMean to compute an average brain to use as an underlay.
A common question is, was there more activity during the active state than during the control state? More particularly, was there more power? Use 3dttest to test the hypothesis that one state had significantly more or less power than the other.
3dttest -base1 0 -set2 s1+tlrc s2+tlrc … sn+tlrc
The -base1 0 option means that this will test to see if any voxels are significantly different from zero (two-tailed). Zero means, for a -D3 image, that the active and control states are the same (see SAMOutput).
Putting this all together, here's a fake but complete script, called dowarp, that normalizes, warps, and tests N subjects' data for increases or decreases in power, in several bands and conditions, based on previously computed pseudo-F SAM volumes. The datasets are listed in dslist, and live in the data subdirectory, and the Talairached structural BRIKs for each subject are in individual subdirectories of mri. Notice how the subject code is extracted from the dataset name, and used to find the MRI BRIK. Also notice that you probably need more than 4 subjects.
#! /bin/sh
dslist="subj1_study_date_01.ds \
subj2_study_date_01.ds \
subj3_study_date_01.ds \
subj4_study_date_01.ds"
doit() {
lo=$1
hi=$2
cond=$3
rm -rf warpdir
mkdir warpdir
n=1
for ds in $dslist; do
s=`echo $ds | cut -d_ -f1`
3dNormalize data/$ds/SAM/${cond},${lo}-${hi}Hz,D3.svl \
warpdir/s$n
adwarp -dxyz 7 -apar mri/$s/ortho+tlrc \
-dpar warpdir/s${n}+orig
n=`expr $n + 1`
done
3dttest -prefix ${cond},${lo}-${hi}Hz -base1 0 \
-set2 warpdir/s*+tlrc.BRIK
}
for c in cond1 cond2 cond3; do
for b in "4 7" "8 12" "14 30" "30 50"; do
doit $b $c
done
done
The subdirectory warpdir is used to hold temporary, intermediate BRIKs, which are just numbered by subject. The result is written into the current directory.