Order of the sub-briks saved from SPMG1/2 functions with parametric/amplitude modulation.

Dear AFNI Experts,

I have some questions related with the order of the sub-briks saved when in the 3dDeconvolve we use SPMG1 and SPMG2 functions with parametric/amplitude modulation. More specifically, within my 3dDeconvolve I have a regressor (S=scenario) for which I apply one parametric modulator when the SPMG1 and SPMG2 functions is used. My questions are:

  1. When the SPMG1 function is used, I have 2 betas as the output of this regressor: one when the parametric modulation is applied, and another one when the parametric modulation is not applied. I get the sub-briks under this names: S#0 and S#1. Which beta contain the effect of parametric modulation and which doesn’t?

  2. When the SPMG2 function is used, I have 4 betas as the output of this regressor: 2 betas are for the two parameters of the SPMG2 function (gamma variate and its derivatives) without parametric modulation and another 2 betas of the two parameters of the SPMG2 function with parametric modulation. I get the sub-briks under this names: S#0, S#1, S#2 and S#3. Which beta contain the effect of parametric modulation and which doesn’t? Also, which beta is related with gamma variate and which beta is related with its derivatives?

  3. When I extract a contrast from my regressor (S-I = scenario - instruction), which beta is considered for the glt (S-I) regressor:

  • for SPMG2: the beta of the gamma variate or its derivatives and with or without parametric modulation?
  • for SPMG1: the beta with or without parametric modulation (because here I don’t have two components of the SPMG function)?
    I ask you this because when I apply the contrast I have only one beta for the new regressor (S-I), not 4, as it is when I look only at S as the regressor with SPMG2 function (or 2, as it is when I look only at S as the regressor with SPMG1 function).

Those are the conditions included in the model when SPMG2 function is used within the 3dDeconvolve command:

-stim_times 1 ${global_path}/timings/${i}.baseline.1D ‘SPMG2(12)’
-stim_label 1 B
-stim_times 2 ${global_path}/timings/${i}.instructions.1D ‘SPMG2(40)’
-stim_label 2 I
-stim_times_AM2 3 ${global_path}/timings/parametric_modulation/${i}_scenarios.parametric_modulation.1D ‘SPMG2(90)’
-stim_label 3 S
-jobs 10
-num_glt 5
-gltsym ‘SYM: B’
-glt_label 1 B
-gltsym ‘SYM: I’
-glt_label 2 I
-gltsym ‘SYM: S’
-glt_label 3 S
-gltsym ‘SYM: S -I’
-glt_label 4 S-I
-gltsym ‘SYM: S -B’
-glt_label 5 S-B \

and those are all the sub-briks saved in the stats bucket:
– At sub-brick #0 ‘Full_Fstat’ datum type is float: 0 to 14.9029
statcode = fift; statpar = 8 561
– At sub-brick #1 ‘B#0_Coef’ datum type is float: -22.4646 to 11.5551
– At sub-brick #2 ‘B#0_Tstat’ datum type is float: -7.86908 to 5.31272
statcode = fitt; statpar = 561
– At sub-brick #3 ‘B#1_Coef’ datum type is float: -9.29495 to 16.3052
– At sub-brick #4 ‘B#1_Tstat’ datum type is float: -6.09724 to 4.14403
statcode = fitt; statpar = 561
– At sub-brick #5 ‘B_Fstat’ datum type is float: 0 to 33.3747
statcode = fift; statpar = 2 561
– At sub-brick #6 ‘I#0_Coef’ datum type is float: -16.0621 to 14.8091
– At sub-brick #7 ‘I#0_Tstat’ datum type is float: -8.56151 to 8.04546
statcode = fitt; statpar = 561
– At sub-brick #8 ‘I#1_Coef’ datum type is float: -8.46298 to 21.117
– At sub-brick #9 ‘I#1_Tstat’ datum type is float: -5.57765 to 6.05574
statcode = fitt; statpar = 561
– At sub-brick #10 ‘I_Fstat’ datum type is float: 0 to 36.6522
statcode = fift; statpar = 2 561
– At sub-brick #11 ‘S#0_Coef’ datum type is float: -12.3703 to 10.7999
– At sub-brick #12 ‘S#0_Tstat’ datum type is float: -7.27428 to 6.58525
statcode = fitt; statpar = 561
– At sub-brick #13 ‘S#1_Coef’ datum type is float: -8.05616 to 10.6207
– At sub-brick #14 ‘S#1_Tstat’ datum type is float: -6.4219 to 8.01995
statcode = fitt; statpar = 561
– At sub-brick #15 ‘S#2_Coef’ datum type is float: -4.91785 to 3.63253
– At sub-brick #16 ‘S#2_Tstat’ datum type is float: -6.23377 to 7.61315
statcode = fitt; statpar = 561
– At sub-brick #17 ‘S#3_Coef’ datum type is float: -4.04931 to 4.21428
– At sub-brick #18 ‘S#3_Tstat’ datum type is float: -4.64824 to 6.41967
statcode = fitt; statpar = 561
– At sub-brick #19 ‘S_Fstat’ datum type is float: 0 to 21.5786
statcode = fift; statpar = 4 561
– At sub-brick #20 ‘B_GLT#0_Coef’ datum type is float: -23.0071 to 16.4011
– At sub-brick #21 ‘B_GLT#0_Tstat’ datum type is float: -6.78155 to 5.67067
statcode = fitt; statpar = 561
– At sub-brick #22 ‘B_GLT_Fstat’ datum type is float: 0 to 45.9894
statcode = fift; statpar = 1 561
– At sub-brick #23 ‘I_GLT#0_Coef’ datum type is float: -16.0669 to 22.1951
– At sub-brick #24 ‘I_GLT#0_Tstat’ datum type is float: -6.0508 to 6.24297
statcode = fitt; statpar = 561
– At sub-brick #25 ‘I_GLT_Fstat’ datum type is float: 0 to 38.9746
statcode = fift; statpar = 1 561
– At sub-brick #26 ‘S_GLT#0_Coef’ datum type is float: -17.7516 to 17.9541
– At sub-brick #27 ‘S_GLT#0_Tstat’ datum type is float: -6.15808 to 7.99587
statcode = fitt; statpar = 561
– At sub-brick #28 ‘S_GLT_Fstat’ datum type is float: 0 to 63.934
statcode = fift; statpar = 1 561
– At sub-brick #29 ‘S-I_GLT#0_Coef’ datum type is float: -21.8565 to 15.2836
– At sub-brick #30 ‘S-I_GLT#0_Tstat’ datum type is float: -6.4461 to 7.70811
statcode = fitt; statpar = 561
– At sub-brick #31 ‘S-I_GLT_Fstat’ datum type is float: 0 to 59.4149
statcode = fift; statpar = 1 561
– At sub-brick #32 ‘S-B_GLT#0_Coef’ datum type is float: -17.2926 to 21.6195
– At sub-brick #33 ‘S-B_GLT#0_Tstat’ datum type is float: -5.40342 to 6.5544
statcode = fitt; statpar = 561
– At sub-brick #34 ‘S-B_GLT_Fstat’ datum type is float: 0 to 42.9601
statcode = fift; statpar = 1 561

For the SPMG1 function the same conditions were included and the sub-briks saved in the stats bucket are similar to those for the SPMG2, except that for the SPMG1, having only one parameter not 2 parameters, only 2 betas are generated/saved for the S regressor (not 4 betas as it is shown above, with the SPMG2 function).

I tried to verify the index list for regressors using something 1d_tool.py as you suggest here, but this is just showing the list of the index, as below, is not giving information related to how the sub-briks and regressors are sorted out:
index 0, group -1 , label Run#1Pol#0
index 1, group -1 , label Run#1Pol#1
index 2, group -1 , label Run#1Pol#2
index 3, group -1 , label Run#1Pol#3
index 4, group -1 , label Run#1Pol#4
index 5, group -1 , label Run#2Pol#0
index 6, group -1 , label Run#2Pol#1
index 7, group -1 , label Run#2Pol#2
index 8, group -1 , label Run#2Pol#3
index 9, group -1 , label Run#2Pol#4
index 10, group -1 , label Run#3Pol#0
index 11, group -1 , label Run#3Pol#1
index 12, group -1 , label Run#3Pol#2
index 13, group -1 , label Run#3Pol#3
index 14, group -1 , label Run#3Pol#4
index 15, group -1 , label Run#4Pol#0
index 16, group -1 , label Run#4Pol#1
index 17, group -1 , label Run#4Pol#2
index 18, group -1 , label Run#4Pol#3
index 19, group -1 , label Run#4Pol#4
index 20, group -1 , label Run#5Pol#0
index 21, group -1 , label Run#5Pol#1
index 22, group -1 , label Run#5Pol#2
index 23, group -1 , label Run#5Pol#3
index 24, group -1 , label Run#5Pol#4
index 25, group 1 , label B#0
index 26, group 2 , label I#0
index 27, group 3 , label S#0
index 28, group 3 , label S#1
index 29, group 0 , label sub-01_6_motion_runs-concatenated.demean[0]#0
index 30, group 0 , label sub-01_6_motion_runs-concatenated.demean[1]#0
index 31, group 0 , label sub-01_6_motion_runs-concatenated.demean[2]#0
index 32, group 0 , label sub-01_6_motion_runs-concatenated.demean[3]#0
index 33, group 0 , label sub-01_6_motion_runs-concatenated.demean[4]#0
index 34, group 0 , label sub-01_6_motion_runs-concatenated.demean[5]#0

Thank you in advance for your help!

When the SPMG1 function is used, … I get the sub-briks under this names: S#0 and ​S#1. Which beta contain the effect
of parametric modulation and which doesn’t?

S#0 is the intercept while S#1 is the slope (modulation).

When the SPMG2 function is used, … I get the sub-briks under this names: S#0, S#1, S#2 and S#3. Which beta contain
the effect of parametric modulation and which doesn’t? Also, which beta is related with gamma variate and which beta is
related with its derivatives?

S#0 is associated with the major component of the hemodynamic response while S#1 corresponds to the first-order derivative. S#2 and S#3 are their corresponding slope (modulation) effects.

When I extract a contrast from my regressor (S-I = scenario - instruction), which beta is considered for the glt (S-I) regressor

If you want to obtain the contrast for the intercept, do this:

-gltsym ‘SYM: S[0] -I[0]’ \

You can extend this similarly to the other components.

Thanks Gang for your quick and clear answer! It really helps me a lot!

I have few other questions please:

  1. Now is clear to me that for SPMG1: S#0 will give me the intercept (and is associated with the major component of the hemodynamic response, as the first component from SPMG2, right? ) and S#1 will give me the slope, or the signal modulated by the parametric modulation of the function component (please correct me if I am wrong). I still don’t know what will represent the output for which I ask just the regular glt (S-I) regressor, without specifically mentioning which contrast (intercept = 0 or slope =1) to provide? It will provide kind of an average between those contrasts (intercept/slope)?

  2. Also, for SPMG2, I understand that S#0 and S#1 will provide the intercepts (S#0 representing the major component of the hemodynamic response while S#1 representing the first-order derivative), while S#2 and S#3 are the corresponding slope/modulation effects of the two components of the SPMG2 function (again, please correct me if I am wrong). Similar for SPMG1, what significance will have the output for which I ask just the regular glt (S-I) regressor, without specifically mentioning which contrast to provide (0/1=intercept/slope without modulation and 2/3=intercept/slope with modulation)?

Thanks in advance for your help!

P.S. I had some issues with accessing my AFNI Message Board account, therefore I come back to this topic a little bit late.

S#0 will give me the intercept (and is associated with the major component of the hemodynamic response,
as the first component from SPMG2, right? ) and S#1 will give me the slope, or the signal modulated by the
parametric modulation of the function component (please correct me if I am wrong).

Yes, that’s right.

I still don’t know what will represent the output for which I ask just the regular glt (S-I) regressor, without
specifically mentioning which contrast (intercept = 0 or slope =1) to provide? It will provide kind of an average
between those contrasts (intercept/slope)?

It does not make scientific nor physical sense to average the intercept with the slope. The two have different unit, similar to the difference between distance and speed.

I understand that S#0 and S#1 will provide the intercepts (S#0 representing the major component of the
hemodynamic response while S#1 representing the first-order derivative), while S#2 and S#3 are the corresponding
slope/modulation effects of the two components of the SPMG2 function (again, please correct me if I am wrong).

Correct.

Similar for SPMG1, what significance will have the output for which I ask just the regular glt (S-I) regressor, without specifically
mentioning which contrast to provide (0/1=intercept/slope without modulation and 2/3=intercept/slope with modulation)?

Again that’s not meaningful nor interpretable when you average the two effects.

Thanks Gang for your answers!

I have two other concerns:

A) Since the average of the two effects for SPMG1 (with and without parametric modulation) is not meaningful/interpretable, I wanted to obtain the individual contrast for:

  1. the intercept, by doing this:
    -gltsym ‘SYM: S[0] -I[0]’ \

  2. and the slope, by doint this:
    -gltsym ‘SYM: S[1] -I[1]’ \

However, when I process the data I get an error message related with the selector for the index 1, like this one:


GLT matrix from ‘SYM: S’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0

GLT matrix from ‘SYM: S -I’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 1 0 0 0 0 0 0

GLT matrix from ‘SYM: S[0] -I[0]’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0
** ERROR: selector index 1 is out of range 0…0

GLT matrix from ‘SYM: S[1] -I[1]’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0

Similar error is showed for other contrasts (e.g. S[1] -B[1]).
The analysis is done, in a sense that I still get this contrast as a sub-brik in the stats-bucket generated when the regression is done. Still, being an error message, and based on one of your advice from some tutorial related with the error messages versus warning messages, I am wondering whether I should/shouldn’t worry about this error message printed out in the terminal, and eventually what it means?

B) As for the SPMG1, when I do the analysis for SPMG2, since the average of the four effects for SPMG2 (two with and other two without parametric modulation) is not meaningful/interpretable, I wanted to obtain the individual contrast for:

  1. the intercept of the major component of the hemodynamic response, by doing this:
    -gltsym ‘SYM: S[0] -I[0]’ \

  2. the intercept of the first-order derivative, by doing this:
    -gltsym ‘SYM: S[1] -I[1]’ \

  3. the slope (modulation) of the major component of the hemodynamic response, by doing this:
    -gltsym ‘SYM: S[2] -I[2]’ \

  4. and the slope (modulation) of the first-order derivative, by doint this:
    -gltsym ‘SYM: S[3] -I[3]’ \

However, when I process the data I get similar error message, related with the selector for the index 1 (again only when the modulation effect is considered, this time for both components of SPMG2), like this one:


GLT matrix from ‘SYM: S’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0

GLT matrix from ‘SYM: S -I’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1 1 1 1 1 0 0 0 0 0 0

GLT matrix from ‘SYM: S[0] -I[0]’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0 0 0 0

GLT matrix from ‘SYM: S[1] -I[1]’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0 0 0

** ERROR: selector index 2 is out of range 0…1

GLT matrix from ‘SYM: S[2] -I[2]’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1 0 0 1 0 0 0 0 0 0 0

** ERROR: selector index 3 is out of range 0…1

GLT matrix from ‘SYM: S[3] -I[3]’:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1 0 0 0 1 0 0 0 0 0 0

Like for SPMG1, for SPMG2 similar error is showed for other contrasts (e.g. S[1] -B[1]).
As above, the analysis is done, in a sense that I still get all those contrasts as sub-briks in the stats-bucket generated when the regression is done. Still, being an error message, and based on one of your advice from some tutorial related with the error messages versus warning messages, I am wondering whether I should/shouldn’t worry about this error message printed out in the terminal, and eventually what it means?

Thanks in advance for your help!
Ruben.

Ruben,

When you use SPMG1, there is only basis function. So, I assume your 3dDeconvolve script contains the following:

-stim_times 1 ${global_path}/timings/${i}.baseline.1D ‘SPMG1(12)’
-stim_label 1 B
-stim_times 2 ${global_path}/timings/${i}.instructions.1D ‘SPMG1(40)’
-stim_label 2 I
-stim_times_AM2 3 ${global_path}/timings/parametric_modulation/${i}_scenarios.parametric_modulation.1D ‘SPMG1(90)’
-stim_label 3 S \

‘SYM: S[1] -I[1]’

This contrast does not make sense. There is only one regression coefficient for I (which is I[0]; thus, I[1] does not exist. And you have the same problem with S[1] -B[1] because you don’t have B[1].

Similarly for SPMG2, you only have two regression coefficients for B and I. Therefore, B[2], B[3], I[2] and I[3] do not exist.

Hi Gang,

You are right, now for SPMG1 I have only one regression coefficient for I and B and two for S (and for SPMG2 I have only two regression coefficient for I and B and four for S).

So in this case, if I still want to see the contrast between the S regressor and I/B regressors considering the parametric modulation effect, what will be an appropriate approach?

  1. for SPMG1: I should do S[1] - I[0] OR will be better to do S[1]-I[1] including the parametric modulation for the regressor I too (by using the same parametric modulation value which is used for the S regressor, since both regressors - S and I - are composing the same trial from the run for the subject, just the task of I and S regressor is different)? Also, should I consider the S[1] - B[0] OR will be better to do S[1]-B[1] including the parametric modulation for the regressor B too (again, using the same parametric modulation value which is used for S regressor)?

  2. for SPMG2: I should do S[2]-I[0] and S[3]-I[1] OR will be better to do S[2]-I[2] and S[3]-I[3] including the parametric modulation for the regressor I too, like for SPMG1? Also, should I consider the S[2]-B[0] and S[3]-B[1] OR will be better to do S[2]-B[2] and S[3]-B[3] including the parametric modulation for the regressor B too, like above?

Thanks in advance for your precious answers!

Ruben.

for SPMG1: I should do S[1] - I[0] OR will be better to do S[1]-I[1] including the parametric modulation for the regressor I too

S[1] - I[0] is not meaningful. If it makes sense to estimate the slope effect for I, then go with S[1]-I[1]. This equally applies to S[1]-B[1]

Also for SPMG2, try S[2]-I[2] and S[3]-I[3] with slope effect modeled for all conditions/tasks.

Hi Gang,

For SPMG1, if the parametric modulation is related only to the regressor S, and I still want to see the contrast S-I, while for S is considered the parametric modulation effect, S[1]-I[0] shouldn’t be an option? Taking a closer look at the experimental design, I am not convinced that the modulation effect can be attributed to the regressor I, so probably it will not make sense to estimate the slope effect for I. Similar question is for the contrast S-B: S[1]-B[0] could be considered if only for the regressor S is considered the parametric modulation effect, and not for the regressor B?

Function of your answer to SPMG1 case, I will see what are the appropriate contrasts for the SPMG2 case.

Thanks,
Ruben.

For SPMG1, if the parametric modulation is related only to the regressor S, and I still want to see the contrast S-I,
while for S is considered the parametric modulation effect, S[1]-I[0] shouldn’t be an option?

Unfortunately no. In that case, S[1] is the slope effect (e.g., speed) while I[0] is the intercept (e.g., distance). The comparison between the two is not interpretable.

Hi Gang,

I understand slope effect and intercept are two different outputs. In this case it will be fair enough to use the same parametric modulation for the all regressors included in contrasts (e.g. I and B), if we are sill interested in looking at some contrast (e.g. S-I, S-B)? Alternatively, we can use the parametric modulation only for a specific regressor, without considering any contrast (e.g. S-I, S-B)?

Also, as I previously mentioned, I got the error message related with the selector for the indexes (index 1 for SPMG1 and indexes 2 and 3 for SPMG2). However, I still got the sub-briks of those contrasts, even if the error showed up. I don’t understand why the sub-brik was still generated (since it is not interpretable)? How was this output/sub-brik computed, in this way S[1]-I[0] (which is not meaningful)?

Thanks,
Ruben.

it will be fair enough to use the same parametric modulation for the all regressors included in contrasts (e.g. I and B),
if we are sill interested in looking at some contrast (e.g. S-I, S-B)? Alternatively, we can use the parametric modulation
only for a specific regressor, without considering any contrast (e.g. S-I, S-B)?

I’m not familiar with the experiment specifics, so I can’t say whether it’s reasonable to apply the same modulation for all the conditions. You have to make the judgment call.

In addition, when modulation is involved, the notions of S-I and S-B are not necessarily meaningful unless an index is specified. Again, you can’t compare orange (intercept) to apple (slope).

Also, as I previously mentioned, I got the error message related with the selector for the indexes (index 1 for SPMG1
and indexes 2 and 3 for SPMG2). However, I still got the sub-briks of those contrasts, even if the error showed up.

3dDeconvolve may tend to generate something, but it is not clear to me what the results mean. Regardless, if what you specified is not meaningful, there is no point pursuing (or talking about) such a dangling end.