Conjunction Analysis
Suppose we are interested in finding out the overlapping regions in the brain among a set of contrasts. Those regions can be obtained through 3dcalc, a general purpose program for performing logic and arithmetic calculations.
The pivotal part of this analysis is a special function called Heaviside Unit, or Step Function,
Some expressions of step function can be used to select voxels with values v meeting certain criteria:
- Find voxels where v > th and mark them with value=1
expression = step (v – th)
- In a range of values: thmin≤ v ≤ thmax
expression = step (v – thmin) * step (thmax - v)
- Exact value: v = n
expression = equals(v – n)
- Create masks to apply to statistical (t or F) subbriks: Two values both above threshold (e.g., active in both tasks; “conjunction”)
expression = step(v-A)*step(w-B)
- Voxels thresholded with two statistics (one with threshold value of A while the other with B).
1. Assume we would like to obtain conjunction among 3 contrasts: A vs D, B vs D, and C vs D.
A > D ==> 1;
B > D ==> 2;
C > D ==> 4
(2) Create a mask with 3 t statistical subbriks (with a hypothetical t threshold of 4.2):
3dcalc -a func+tlrc'[5]' -b func+tlrc'[10]' -c func+tlrc'[15]‘ -expr 'step(a-4.2)+2*step(b-4.2)+4*step(c-4.2)' -prefix cond_mask
(3) There are totally 23 = 8 possible combinations (not necessarily all interesting) among the 3 contrasts:
0 – none;
1 - A > D but no others;
2 - B > D but no others;
3 - A > D and B > D but not C > D;
4 - C > D but no others;
5 - A > D and C > D but not B > D;
6 - B > D and C > D but not A > D;
7 – all 3 contrasts
2. Suppose we want to differentiate the direction of two contrasts. Conjunction analysis can be done with
-expr 'step(a-athreshold) + 2*step(b-bthreshold) + 4*step (-athreshold-a) + 8*step (-bthreshold-b)'
And the resulting map can be interpreted as the following:
0: no activation and no deactivation;
1: activation in condition 1 only;
2: activation in condition 2 only;
3: activation in both conditions;
4: deactivation in condition 1 only;
6: activation in condition 2 and deactivation in condition 1;
8: deactivation in condition 2 only;
9: activation in condition 1 and deactivation in condition 2;
12: deactivation in both conditions.
3. If the above example sounds too complicated, maybe this following generalization is more revealing. With a binary system (just as a tribe in Australia used to count) we can label each contrast the following way: active if 1; inactive if 0.
Let's assume we have 4 contrasts A, B, C, and D. With a binary system (just as a tribe in Australia used to count) we can label each contrast the following way: active if 1; inactive if 0.
Then in 3dcalc we assign a coefficient of 2^n for each contrast, where n is the ordinal number of the contrast. In the example of 4 contrasts, we assign 2^0, 2^1, 2^2, and 2^3 (i.e., 1, 2, 4, and 8) to A, B, C, and D. Thus we put the following in 3dcalc
-expr 'step(a-athreshold) + 2*step(b-bthreshold) + 4*step (c-cthreshold) + 8*step (d-dthreshold)'
Then in the output we can interpret the result as the tribal people did:
0000 (=0): None active;
0001 (=1): Only A active;
0010 (=2): Only B active;
0011 (=3): only A and B active;
...
If the total number of possibilities is too overwhelming to visualize on AFNI, you can eliminate those you are not interested in with a boolean function 'bool' to combine them into one confunding value:
bool(x) = 1 if x is not 0, 0 otherwise.
* Back to Gang Chen's home page
2. Suppose we want to differentiate the direction of two contrasts. Conjunction analysis can be done with
-expr 'step(a-athreshold) + 2*step(b-bthreshold) + 4*step (-athreshold-a) + 8*step (-bthreshold-b)'
And the resulting map can be interpreted as the following:
0: no activation and no deactivation;
1: activation in condition 1 only;
2: activation in condition 2 only;
3: activation in both conditions;
4: deactivation in condition 1 only;
6: activation in condition 2 and deactivation in condition 1;
8: deactivation in condition 2 only;
9: activation in condition 1 and deactivation in condition 2;
12: deactivation in both conditions.
3. If the above example sounds too complicated, maybe this following generalization is more revealing. With a binary system (just as a tribe in Australia used to count) we can label each contrast the following way: active if 1; inactive if 0.
Let's assume we have 4 contrasts A, B, C, and D. With a binary system (just as a tribe in Australia used to count) we can label each contrast the following way: active if 1; inactive if 0.
Then in 3dcalc we assign a coefficient of 2^n for each contrast, where n is the ordinal number of the contrast. In the example of 4 contrasts, we assign 2^0, 2^1, 2^2, and 2^3 (i.e., 1, 2, 4, and 8) to A, B, C, and D. Thus we put the following in 3dcalc
-expr 'step(a-athreshold) + 2*step(b-bthreshold) + 4*step (c-cthreshold) + 8*step (d-dthreshold)'
Then in the output we can interpret the result as the tribal people did:
0000 (=0): None active;
0001 (=1): Only A active;
0010 (=2): Only B active;
0011 (=3): only A and B active;
...
If the total number of possibilities is too overwhelming to visualize on AFNI, you can eliminate those you are not interested in with a boolean function 'bool' to combine them into one confunding value:
bool(x) = 1 if x is not 0, 0 otherwise.
* Back to Gang Chen's home page