why my 3dcalc does not work?

HI Experts,

According to this webpage: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dttest.html
3dtttest program accepts datasets that are modified on input according to the following schemes: ‘3dcalc( -a r1+orig -b r2+orig -expr 0.5*(a+b) )’ {calculation}

With this in mind, I tried to do the t-test below, but it could not run (below is just a part of the script).

3dtttest++ -prefix ./Output_Cond/T_Test_Gain_Vs_Neutral_ShapeFixed
-mask …/mask_overlap.7+tlrc.
-labelA Gain_Loss
-setA ‘3dcalc(-a /home/Test_Data/Sub1/Sub1_Shapefixed+tlrc.BRIK’[1]’ -b /home/Test_Data/Sub1/Sub1_Shapefixed+tlrc.BRIK’[3]’ -expr 0.5*(a+b))’
……
-labelB Neutral
-setB /home/Test_Data/Sub1/Sub1_Shapefixed+tlrc.BRIK’[5]’
….

Of course, I can do this step by step: first do the 3dcalc, then do this 3dttest++. I have two questions below.

  1. Does 3dtttest++ program accept datasets that are modified by 3dcalc? How should I modify it? In my case, the PATH is also inserted.

  2. Now I try to compare the “[Brick (1) + Brick (3)]*0.5” and “Brick (5)”. Should I go back to redo the 3dDeconvolve, by collapsing the regressor 1 and regressor 2 (i.e., they are corresponding to the Brick (1) and (3) here) as one regressor? Would the results be different? I assume it should be the same. Am I correct?

Thanks so much,
Juan

Juan,

  1. Does 3dtttest++ program accept datasets that are modified by 3dcalc? How should I modify it?
    In my case, the PATH is also inserted.

The functionality with 3dcalc in the link you provided is for 3dttest, a precursor of 3dttest++. As you’ve found out, 3dttest++ probably does not work properly with that embedded 3dcalc command yet.

  1. Now I try to compare the “[Brick (1) + Brick (3)]*0.5” and “Brick (5)”. Should I go back to redo
    the 3dDeconvolve, by collapsing the regressor 1 and regressor 2 (i.e., they are corresponding
    to the Brick (1) and (3) here) as one regressor? Would the results be different? I assume it
    should be the same. Am I correct?

No, you don’t need to obtain the combination with 3dDeconvolve. Instead 3dcalc should be good enough for your purpose.

Alternatively (and probably better) you can treat Bricks 1, 3 and 5 as three levels of a within-subject factor, and run a one-way within-subject ANOVA with 3dANOVA2 -type 3. And specify the contrast of “[Brick (1) + Brick (3)]*0.5” vs “Brick (5)” with option -acontr in 3dANOVA2.

  1. Since you don’t give the error message, it is hard to say what the problem is. In general, I would recommend avoiding very complex command lines like this, and do it in 3 steps: 3dcalc as needed, 3dttest++, then delete the temporary files

  2. In general, it is not true that regressing with the average of 2 regressors gives the result that is the average of the separate regressions. This happens because the result of the regression is not a linear function of the regressors – it is a linear function of the DATA. So if you have 2 separate (perhaps similar) conditions that lead to Brick(1) and Brick(3), and then want to see where ignoring their differences leads to changes from Brick(5), in my opinion you should average Brick(1) and Brick(3) and then test vs. Brick(5) – as you seem to be trying to do. Otherwise, you are carrying out a separate analysis with the merged #1 and #3 regressors, and then how do you compare that to the analysis results from the separated #1 and #3 cases?

In the case that the regressors from #1 and #3 are orthogonal and have the same L2 norm, then the results of the 2 procedures would be the same. This would be the case if the 2 regressors had the same number of stimuli, and the stimuli were separated in time enough so there was no overlap between the responses.

Thanks so much for your both. I have a further and special question for Bob.

Bob, I agree with you - that is very clear thinking. Suppose in my experiment (this is only for our discussion), I have three events: positive, negative and neutral. I can do the 3dDeconvolve in two ways, if I want to know the effect of emotion (i.e., positive and negative ones) vs. neutral. I define emotion as “positive + negative” here.

3dDeconvolve –input run_1+orig run_2+orig -nfirst 0 –polort 2
-num_stimts 2
-stim_times 1 Emotion_onsets ‘GAM’ -stim_label 1 Emotion
-stim_times 2 Neutral_onsets ‘GAM’ -stim_label 2 Neutral
-num_glt 1
-gltsym “SYM: Emotion -Neutral” -glt_label 1 Emotion_vs_Neutral
-fitts fit_ts –errts error_ts
-xjpeg glm_matrix.jpg
–tout –fout -bucket glm_out1

3dDeconvolve –input run_1+orig run_2+orig -nfirst 0 –polort 2
-num_stimts 3
-stim_times 1 Postive_onsets ‘GAM’ -stim_label 1 Postive
-stim_times 2 Negative_onsets ‘GAM’ -stim_label 2 Negative
-stim_times 3 Neutral_onsets ‘GAM’ -stim_label 3 Neutral
-num_glt 3
-gltsym “SYM: Postive -Neutral” -glt_label 1 Postive_vs_Neutral
-gltsym “SYM: Negative -Neutral” -glt_label 2 Negative_vs_Neutral
-gltsym “SYM: 0.5Postive + 0.5Negative -Neutral” -glt_label 3 Emotion_vs_Neutral
-fitts fit_ts –errts error_ts
-xjpeg glm_matrix.jpg
–tout –fout -bucket glm_out2

The 2nd 3dDeconvolve is used as I thought that the comparisons “Positive vs. Neutral”, “Negative vs. Neutral” would be interesting. Now I find that the Emotion vs. Neutral is more helpful, however.

According to your suggestion, it seems that the results of “Emotion vs. Neutral” would be different from those two different 3dDeconvolve approaches. Then which one should be trusted and reported?

Thanks so much for your time,
Juan

The second model is definitely preferred and more accurate unless there is indication that the two emotions (positive and negative) cannot be differentiated by humans.

HI Gang,

Woops, I arbitrarily used that only as an example. For instance, you also can assume that three conditions are as

Larger Reward condition”, “General Reward condition”, and “Neutral”.

Usually, people assume that there are difference between Large and General reward. My question is that if I now do not care the “Larger, or General reward” manipulation, I only hope to know the Reward vs. Neutral -which 3dDeconvolve model is better? I define the reward as the mean of “Larger, and General reward” here. As discussed above, there are some difference between two 3dDeconvolve models. Which one is more trust-able?

Again, thanks so much for your time.
J

My question is that if I now do not care the “Larger, or General reward” manipulation,
I only hope to know the Reward vs. Neutral -which 3dDeconvolve model is better?

The answer remains the same. The crucial point here is not what is the post hoc interest/focus from the investigator, but how the brain presumably responds to the two emotions or reward conditions. In other words, a good model should characterize the effects (brain responses) as accurately as possible. If you do believe that brain regions can differentiate large and general rewards, then the two conditions should be treated as two different effects (or regressors) in the model.