Strange gltsym Problem

I have used gltsym before for contrasts but for reasons I don’t understand (I thought it was a white space error or something) when it plug it into the afni proc the gltsym in the tcsh is all over the place for example ’ separating parts of my titles. I ended up fixing the gltsym part of 3dDeconvolve on my own but I get command not found errors for gltsym. Below is an example of what I put into the afni proc. Note: I have changed labels and paths in order to save space. If you want the original text I can send it to you via email.

Thanks for your help
-subj_id TestofTent${subject}_${runname}
-copy_anat /Users/jd/testoftent/anat/struc1_e1.nii
-dsets /Users/jd/testoftent/func/func?.nii
-blocks despike align volreg blur mask scale regress
-script Testoftent_Contrast.tcsh
-volreg_align_to MIN_OUTLIER
-volreg_allin_cost lpa+zz
-volreg_post_vr_allin yes
-volreg_pvra_base_index MIN_OUTLIER
-align_opts_aea -AddEdge -giant_move
-blur_size 4
-regress_stim_times /Users/jd/testoftent/stimuli/.txt
-regress_stim_labels p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12
-regress_basis_multi ‘TENT(0,17.6,16)’ ‘TENT(0,17.6,16)’ ‘TENT(0,17.6,16)’ ‘TENT(0,17.6,16)’ ‘TENT(0,17.6,16)’ ‘BLOCK(64.9,1)’ ‘TENT(0,17.6,16)’ ‘TENT(0,17.6,16)’ ‘TENT(0,17.6,16)’ ‘TENT(0,17.6,16)’ ‘BLOCK(64.9,1)’ ‘TENT(0,17.6,16)’
-regress_censor_motion 0.3
-gltsym 'SYM: +.083
p1 +.083p2 +.083p3 +.083p4 +.083p5 +.083p6 +.083p7 +.083p8 +.083p9 +.083p10 +.083p11 +.083p12’
-glt_label 1 a
-gltsym 'SYM: +.25
p3 +.25p4 +.25p9 +.25p12’
-glt_label 2 b
-gltsym 'SYM: +.5
p2 +.5p8’
-glt_label 3 c
-gltsym 'SYM: +.5
p6 +.5p11’
-glt_label 4 d
-gltsym 'SYM: +.25
p1 +.25p5 +.25p7 +.25p10’
-glt_label 5 e
-gltsym 'SYM: +.167
p1 +.167p2 +.167p3 +.167p4 +.167p5 +.167p6’
-glt_label 6 f
-gltsym 'SYM: +.167
p7 +.167p8 +.167p9 +.167p10 +.167p11 +.167p12’
-glt_label 7 g
-gltsym 'SYM: +.5
p3 +.5p4’
-glt_label 8 h
-gltsym 'SYM: +.5
p9 +.5p12’
-glt_label 9 i
-gltsym 'SYM: +.5
p1 +.5p5’
-glt_label 10 j
-gltsym 'SYM: +.5
p7 +.5p10’
-glt_label 11 k
-gltsym 'SYM: +.5
p2 -.25p3 -.25p4 +.5p8 -.25p9 -.25*p12’
-glt_label 12 l
-jobs 4
-regress_run_clustsim no

Note: It just occurred to me that for the glt labels I had two word names for many of them (with a space between them no _ like I usually use). Could this be the source of the problem?

Yes, spaces in the labels would be a problem, though I am not seeing any such examples here. That might lead to an unrecognised option error. What are the actual error messages from this?

  • rick

I posted a short version I will send the actual version via pm. I just tried it again without spaces in the labels and it still crashes. 3dDeconvolve dies: Unrecognized command line option:


Here is an update. I simply rewrote the the code I was having trouble with and it worked. Yesterday I attempted to do the same thing with another task but when using num_glt I got multiple coeffs and tstats for each contrasts. I removed some contrasts and reran without num_glt and now for each contrast I have two coeffs and two tstats. What might be causing this issue?

Rewriting the problematic code must have fixed either some typo or perhaps a bad (non-ASCII) character in the command.

Using -num_glt should only make a difference when trying to exceed 10 contrasts. It should not affect the outputs from working GLTs. What is the actual text that contains the difference between working and problematic commands?

  • rick

It would be good to see a comparison using what should be the same contrast where there is a difference in shown betas.

The only reason I can see this varying is if some of your '' characters were accidentally sent to 3dDeconvolve, rather than just being processed by the shell. These would be typos to find. Note that if '' is the last character on the line, the shell will use it for line continuation. But if that gets sent to 3dDeconvolve in the middle of a contrast, it turns into a multi-line one.

For example, the difference here is just the extra '' in the middle:

-gltsym ‘SYM: A -B’
-gltsym ‘SYM: A \ -B’

The first is the simple A-B contrast, with 1 beta (and probably a T and an F, if you asked for them).
The second is a 2-line contrast, testing for significance of A, of -B and of both. The output would be one beta for A, one for -B, a t-stat for each (if you asked for it), and an F-stat for the 2-line test.

It seems likely that is what you are running into.

  • rick

Interesting the thing is it is happening to all 14 of the contrasts and I am not seeing \ that are not at the end of a line. Maybe something is up with the text editor I am using (not what I typically work with). I wrote out the command in the text editor and pasted it into the terminal.

Here is an example of what is in the stats file for one of the contrasts (note this is true of all of them every contrasts has two coefs and Tstats)

– At sub-brick #447 ‘ErrorMinusCorrect_GLT#0_Coef’ datum type is float: -42.5341 to 69.2455
– At sub-brick #448 ‘ErrorMinusCorrect_GLT#0_Tstat’ datum type is float: -19.8814 to 17.6943
statcode = fitt; statpar = 2364
– At sub-brick #449 ‘ErrorMinusCorrect_GLT#1_Coef’ datum type is float: -57.0917 to 66.7956
– At sub-brick #450 ‘ErrorMinusCorrect_GLT#1_Tstat’ datum type is float: -12.6328 to 13.6746
statcode = fitt; statpar = 2364
– At sub-brick #451 ‘ErrorMinusCorrect_GLT_Fstat’ datum type is float: 0 to 197.658
statcode = fift; statpar = 2 2364

Below is the corresponding 3dDeconvolve input

-gltsym ‘SYM: -.25abscon_abs_corr -.25abscon_con_corr +.5abscon_error
rhyme_error -.25rhyme_yes_corr -.25rhyme_no_corr’
-glt_label 9 ErrorMinusCorrect \

Thanks Again

Are you running this with bash or tcsh? The line continuation backslash within the quotes might not be appropriate for bash.

Prepend an echo command to the 3dDeconvolve command (so that the command is echoed instead of actually run). Do you see the '' characters? You should not.

Are you running this with bash?

  • rick

The default for my terminal is bash. I plugged it into echo and I don’t notice the \ characters.