TENT in 3dDeconvolve

Dear AFNI experts and users,
Description of the TENT function in the 3dDeconvolve is this: 'TENT(b,c,n)' = n parameter tent function expansion from times b..c after stimulus time [piecewise linear] [n must be at least 2; time step is (c-b)/(n-1)].
I would like to get 12 volumes after stimulus onset. According to this description, (c-b)/n-1=TR. If the TR is 0.72s, the b=0, n=12, then c=TR(n-1)*+b=0.72*(12-1)+0=7.92. Unfortunately, the code echos errors about "++ ----- Signal+Baseline matrix condition (283x134): 8.09903 ++ VERY GOOD ++
*+ WARNING: !! in Signal+Baseline matrix:

  • Largest singular value=3.13546
  • 10 singular values are less than cutoff=3.13546e-07
  • Implies strong collinearity in the matrix columns!"

The whole code and errors reports were attached at the end of this message.
If I used c=TR*n+b=0.72*12+0=8.64, the code is working. Could anyone tell me where I misunderstand.
Thank a lot.
Best
Rujing

The TR in my nii file is 0.72s, the times.1D is "11.009 26.136 41.263 56.39 71.517 101.638 116.765 131.892 162.013 177.14".

AFNI version info (afni -ver): Precompiled binary linux_centos_7_64: Apr 8 2021 (Version AFNI_21.1.01 'Domitian')

this is the code

3dDeconvolve -quiet -input $data_dir/${sb}/LR/tfMRI_MOTOR_LR.nii.gz \
        -num_stimts ${var_num} \
        -stim_file 1 $curr_path/100206/movement/100206/LR/MOTOR_Movement_Regressors.txt[0] -stim_label 1 roll -stim_maxlag 1 1 \
        -stim_file 2 $curr_path/100206/movement/100206/LR/MOTOR_Movement_Regressors.txt[1] -stim_label 2 pitch -stim_maxlag 2 1 \
        -stim_file 3 $curr_path/100206/movement/100206/LR/MOTOR_Movement_Regressors.txt[2] -stim_label 3 yaw -stim_maxlag 3 1 \
        -stim_file 4 $curr_path/100206/movement/100206/LR/MOTOR_Movement_Regressors.txt[3] -stim_label 4 I_S -stim_maxlag 4 1 \
        -stim_file 5 $curr_path/100206/movement/100206/LR/MOTOR_Movement_Regressors.txt[4] -stim_label 5 R_L -stim_maxlag 5 1 \
        -stim_file 6 $curr_path/100206/movement/100206/LR/MOTOR_Movement_Regressors.txt[5] -stim_label 6 A_P -stim_maxlag 6 1 \
        -stim_times_IM 7 $data_dir/${sb}/LR/times.1D 'TENT(0,7.92,12)' -stim_label 7 ${psycho1}\
        -global_times -bucket $output_path/${sb}/LR/polort${polorts}_${sb}_${psycho1}_${var_num}_regress -jobs 90 

this is error reports
'''
mkdir: cannot create directory ‘/home/psylab1/psylab1/liuyan/’: File exists
./MO_IM_extract: line 23: test: too many arguments
mkdir: cannot create directory ‘/home/psylab1/psylab1/liuyan//100206’: File exists
mkdir: cannot create directory ‘/home/psylab1/psylab1/liuyan//100206/LR’: File exists
++ '-stim_times_IM 7 /home/psylab1/psylab1/liuyan/0/100206/LR/times.1D' will have 120 regressors
++ setting number of processes to 32!
++ Skipping check for initial transients
*+ WARNING: Input polort=1; Longest run=204.5 s; Recommended minimum polort=2
++ -stim_times using TR=0.72 s for stimulus timing conversion
++ -stim_times using TR=0.72 s for any -iresp output datasets
++ [you can alter the -iresp TR via the -TR_times option]
++ -stim_times_IM 7 using LOCAL times
++ First time point used in analysis = index #1 (from max maxlag)
++ Number of time points: 284 (before censor) ; 283 (after)

  • Number of parameters: 134 [2 baseline ; 132 signal]
    ++ total shared memory needed = 480,198,628 bytes (about 480 million)
    ++ mmap() memory allocated: 480,198,628 bytes (about 480 million)
    ++ Memory required for output bricks = 480,198,628 bytes (about 480 million)
    ++ ----- Signal+Baseline matrix condition (283x134): 8.09903 ++ VERY GOOD ++
    *+ WARNING: !! in Signal+Baseline matrix:
  • Largest singular value=3.13546
  • 10 singular values are less than cutoff=3.13546e-07
  • Implies strong collinearity in the matrix columns!
    ++ Signal+Baseline matrix singular values:
    0 0 0 0 9.0243e-09
    1.07872e-08 1.95705e-08 2.46159e-08 2.62596e-08 2.9794e-08
    0.0478008 0.0498168 0.0765769 0.0827266 0.11502
    0.173888 0.195914 0.373278 0.387522 0.46481
    0.50308 0.526541 0.536619 0.554659 0.569294
    0.575646 0.581648 0.608429 0.624724 0.639851
    0.680995 0.689649 0.705938 0.713288 0.71944
    0.735332 0.745785 0.753255 0.774118 0.791494
    0.799674 0.805106 0.819283 0.823176 0.830319
    0.832576 0.836452 0.837948 0.844218 0.855848
    0.860385 0.869598 0.88639 0.913593 0.91894
    0.924574 0.94264 0.946113 0.948144 0.952278
    0.954704 0.972281 0.974341 0.97599 0.977671
    0.981349 0.98236 0.983165 0.986256 0.988578
    0.989966 0.993345 0.998572 0.999299 1.00595
    1.00859 1.01242 1.01269 1.01546 1.01579
    1.01904 1.02327 1.02446 1.03007 1.0384
    1.04246 1.05154 1.05341 1.05502 1.07039
    1.07779 1.08947 1.10004 1.11574 1.12191
    1.12797 1.13635 1.13856 1.14379 1.14898
    1.15016 1.15691 1.16505 1.16751 1.17999
    1.19849 1.20204 1.21067 1.2158 1.22245
    1.22416 1.24315 1.26069 1.2685 1.27056
    1.28491 1.29126 1.29624 1.30912 1.32254
    1.32822 1.34155 1.37558 1.39476 1.41423
    1.41439 1.41467 1.41575 1.41608 1.43342
    1.44964 1.47042 1.5669 3.13546
    ++ ----- Signal-only matrix condition (283x132): 7.76915 ++ VERY GOOD ++
    *+ WARNING: !! in Signal-only matrix:
  • Largest singular value=2.97749
  • 10 singular values are less than cutoff=2.97749e-07
  • Implies strong collinearity in the matrix columns!
    ++ Signal-only matrix singular values:
    0 0 0 0 0
    1.13924e-08 1.30855e-08 1.70926e-08 2.15788e-08 2.97951e-08
    0.0493291 0.0826232 0.100531 0.116586 0.174896
    0.333539 0.386032 0.457103 0.470363 0.503065
    0.526747 0.537011 0.554666 0.570114 0.575692
    0.581914 0.608424 0.624724 0.639865 0.688106
    0.693173 0.706242 0.716724 0.719749 0.737175
    0.749735 0.77411 0.791484 0.799669 0.805106
    0.819254 0.823162 0.830289 0.83232 0.836346
    0.837932 0.843975 0.855749 0.860374 0.869592
    0.883001 0.913582 0.918772 0.924372 0.942634
    0.946111 0.948133 0.952262 0.954693 0.97228
    0.974323 0.975981 0.977632 0.981346 0.982357
    0.983159 0.986253 0.988568 0.989965 0.993342
    0.998563 0.999268 1.00595 1.00856 1.0124
    1.0126 1.01542 1.01579 1.01895 1.02313
    1.02445 1.03 1.0384 1.04239 1.0511
    1.05335 1.0545 1.07022 1.0777 1.08925
    1.09954 1.11572 1.12175 1.12796 1.13631
    1.13832 1.14364 1.14794 1.14983 1.15473
    1.16331 1.16684 1.17701 1.19166 1.20167
    1.2096 1.21565 1.22126 1.22399 1.24246
    1.26033 1.26597 1.26984 1.28328 1.28517
    1.29152 1.29773 1.31117 1.32178 1.33777
    1.35013 1.39303 1.41423 1.41429 1.41443
    1.41509 1.41597 1.42304 1.43335 1.46531
    1.4719 2.97749
    ++ ----- Baseline-only matrix condition (283x2): 1.00306 ++ VERY GOOD ++
    ++ ----- polort-only matrix condition (283x2): 1.00306 ++ VERY GOOD ++
    *+ WARNING: +++++ !! Matrix inverse average error = 0.004586 ** BEWARE **
    ++ Matrix setup time = 0.39 s
    ** ERROR: !! 3dDeconvolve: Can't run past 3 matrix warnings without '-GOFORIT 3'
    ** ERROR: !! Currently at -GOFORIT 0
    ** ERROR: !! See file 3dDeconvolve.err for all WARNING and ERROR messages !!
    ** ERROR: !! Be sure you understand what you are doing before using -GOFORIT !!
    ** ERROR: !! If in doubt, consult with someone or with the AFNI message board !!
    ** FATAL ERROR: !! 3dDeconvolve (regretfully) shuts itself down !!
    ** Program compile date = Apr 8 2021
    '''

Hi Rujing,

Using TENT with IM is generally not advisable. Even if the regression works, there is no repetitoin in the model to average over, it will just grab the fully noisy time point values (minus the actual fit regressors). I guess since the onsets are not TR-locked you will at least average between pairs of TRs, but the betas will not have any other noise reduction. The errts will be essentially zero during the task response times.

That is to say, you could use 3dTproject with the regressors of no interest, and then just grab the time series starting at onsets. It should be basically what you would get using the full regression.

Hopefully 7.92s is long enough to model whatever BOLD response you expect. I guess this is not human data.

The event timing is somewhat consistent relative to the TR, which can lead to higher condition numbers/more collinearity. But the within TRs do vary, from approximately 0.02 to 0.2s, which is good. But since you are using IM, the 0.02 offset might lead to a very large beta, for example. TENTs are expected to be evaluated across varying event times, or else be TR-locked.

Getting to your actual question, I do not actually see anything that would cause this failure. Your events are all 15+ seconds apart, so there is no overlap possible in the TENTs.

If you add "-x1D X.xmat.1D", what is the output from:

1d_tool.py -show_cormat_warnings -infile X.xmat.1D

Also, would you please send me that X.xmat.1D file via email? I will send you a direct message with my address.

Also, your AFNI version is 2.5 years old. That should not matter for this issue, but it is a bit old. Just something to ponder.

  • rick

Hi Rick
I have sent the X.xmat.1D to your email box. Thanks a lot.
Best regards.
rujing

Hi Rujing,

Looking at your X-matrix, I am inclined to think one would see this problem basically any time IM is used with even non-overlapping TENTs, like yours. Any single event that is just slightly into the TR might lead to this. They are not exactly collinear, but close.

With IM and TENTs in general, the regressors will have only 1 or 2 non-zero time points. They will fit the data very well (perfectly, in the case of 1), but yeild extremely noisy betas.

You could add -GOFORIT at a high enough level (maybe just 3 here) and see what the results look like. It will probably be a bit messy.

  • rick