AFNI proc py bad sub-brick selector

AFNI experts,

I am running proc py for functional data using stimulus files. In this dataset, there are two conditions (Condition A and Condition B), and three stimulus files (Stim I, Stim C, and Stim F). Firstly, I have compared Stim I and Stim C and the part of the proc py script was like below.

-regress_stim_labels I C
-regress_basis ‘BLOCK(1,1)’
-regress_censor_motion 0.3
-regress_opts_3dD
-gltsym ‘SYM: +I -C’
-glt_label 1 I_vs_C

After preprocessing, I ran 3dttest++ to compare between conditions (Condition A vs Condition B) using the belwo 3dttest++ script.

3dttest++ -prefix Flanker_Ex-Rest
-paired
-mask GM_mask_2009c+tlrc
-clustsim
-setA ConditionA
subject1 stats.subject1.ConditionA+tlrc’[10]’
.
.
subject 30 stats.subject30.ConditionA+tlrc’[10]’
-setB ConditionB
subject1 stats.subject1.ConditionB+tlrc’[10]’
.
.
subject 30 stats.subject30.ConditionB+tlrc’[10]’ \

It was processed successfully and I was able to examine the difference between conditions. Next, I wanted to compare Stim I and Stim F, so rerun the proc using the part of the script below.

-regress_stim_labels I F
-regress_basis ‘BLOCK(1,1)’
-regress_censor_motion 0.3
-regress_opts_3dD
-gltsym ‘SYM: +I -F’
-glt_label 1 I_vs_F \

When running 3dttest++ after preprocessing using the same script above, I had the below error message.

** ERROR: selector index 10 is out of range 0…9
** ERROR: bad sub-brick selector [10]
** FATAL ERROR: Option -setA: can’t open dataset ‘stats.subject1.ConditionA+tlrc[10]’

I changed sub-brick of each subject in 3dttest++ script like below
subject1 stats.subject1.ConditionA+tlrc’[9]’
and it was running successfully, but the data look a little bit weird compared to using sub-brick 10.

Could you please let me know why the sub-brick error occurred even after using the same proc.py script and if using sub-brick 9 instead of 10 is correct?

Thank you in advance for your help,
Jun

It looks like you might only have ten total subbricks in that dset, looking at the error message:


** ERROR: selector index 10 is out of range 0..9

AFNI, as many programming languages like C and Python do, counts starting from 0. So, for a ten item list, you can use indices 0, 1, 2, 3, …, 9.

If you type:


3dinfo -nv DSET

that will tell you how many volumes in your DSET.

If you type:


3dinfo -nvi DSET

that will tell you what the maximum index of your dset is-- which should be N-1, for an N volume dset.

-pt

Hi pt,

I really appreciate your help. The below is what I got for the command you suggested for Stim I vs Stim F

hlhp-105:Proc_results_con-fix titus$ 3dinfo -nv stats.subject1.Condition1+tlrc.
10
hlhp-105:Proc_results_con-fix titus$ 3dinfo -nvi stats.subject1.Condition1+tlrc.
9

The below is what I got from Stim I vs Stim C
hlhp-105:Proc_results_con-fix titus$ 3dinfo -nv stats.subject1.Condition1+tlrc.
13
hlhp-105:Proc_results_con-fix titus$ 3dinfo -nvi stats.subject1.Condition1+tlrc.
2

Could you please let me know why these are different even the proc py script was completely the same except stim files? Also, would that be okay to use sub-brick 9 for Stim I vs Stim F for 3dttest++?

Thanks again,
Jun

Hi Jun,

They have a different number of volumes for some reason, possibly because of contrasts. It is hard to say without seeing the commands.

However, it would be safer not to use selectors like just ‘10’, but rather descriptive labels. And do not use index 9 without being positive what is there. It could be a t- or F-stat, for example. What is the output of this for each condition?

3dinfo -verb stats.subject1.Condition1+tlrc | grep Coef

You can run that without a grep to see all of the details.

  • rick

Hi Rick,

Thanks for the so much for the response.

Here is the result of Stimulus I vs Stimulus F 3dinfo -verb stats.subject1.Condition1+tlrc | grep Coef.

– At sub-brick #1 ‘I#0_Coef’ datum type is float: -2.92984 to 2.53249
– At sub-brick #4 ‘F#0_Coef’ datum type is float: -2.53124 to 3.31587
– At sub-brick #7 ‘I_vs_F_GLT#0_Coef’ datum type is float: -5.13591 to 2.46972

Does it seem that sub-brick 7 should be used for the 3dttest++?

Thank you,
Jun

Hi Jun,

You could even use ‘I_vs_F_GLT#0_Coef’ as the selector, if that is the volume you want to apply. It would mean the same as 7 it seems, except that if your volumes are varying for some reason, using the label would be much more safe.

Were you able to determine how and why the sub-bricks were varying?

  • rick

Hi Rick,

Yes, I figured out that I had all stimuli (I,F,C) in the previous script.

– At sub-brick #1 ‘C#0_Coef’ datum type is float: -24.2262 to 39.3309
– At sub-brick #4 ‘F#0_Coef’ datum type is float: -31.3828 to 31.9878
– At sub-brick #7 ‘I#0_Coef’ datum type is float: -34.3002 to 53.807
– At sub-brick #10 ‘I_vs_C_GLT#0_Coef’ datum type is float: -23.0242 to 17.0529

And, had only stimulus I and F for the following one.

– At sub-brick #1 ‘I#0_Coef’ datum type is float: -2.92984 to 2.53249
– At sub-brick #4 ‘F#0_Coef’ datum type is float: -2.53124 to 3.31587
– At sub-brick #7 ‘I_vs_F_GLT#0_Coef’ datum type is float: -5.13591 to 2.46972

Thank you,