afni_proc.py Fatal 3dDeconvolve Error

AFNI version info (afni -ver): AFNI_23.2.11
Hello AFNI experts!
I ran into an error while running afni_proc.py, it appears this error has to do with my timing files, but I'm not sure why.

Here is the error:

*+ WARNING: '-stim_times_AM2 1' (LOCAL) run#1 has 38 times outside range 0 .. 11 [PSFB syndrome]
 + dataset TR being used is 1 s -- unusable times follow
 17.27 22.99 28.72 35.14 40.77 47.3 54.33 60.16 65.39 71.91 78.23 85.07 91.31 98.33 105.06 110.78 116.29 121.72 335.01 340.42 346.05 351.66 357.99 363.3 369.32 376.14 382.36 388.17 394.69 400.82 407.35 413.17 420.1 426.22 431.95 438.38 443.79 449.85
++ '-stim_times_AM2 1' average amplitude#1=0
++ '-stim_times_AM2 1' average amplitude#2=0.505
++ ** GUESSED ** -stim_times_AM2 2 using LOCAL times
*+ WARNING: '-stim_times_AM2 2' (LOCAL) run#1 has 60 times outside range 0 .. 11 [PSFB syndrome]
 + dataset TR being used is 1 s -- unusable times follow
 161.21 181.32 233.81 267.58 278.92 251.77 313.76 209.97 302.17 272.79 166.06 240.34 198.84 221.12 204.66 257.3 246.44 216.29 153.54 193.88 227.81 307.57 171.03 320.01 284.12 290.71 175.84 296.47 262.24 188.48 551.48 585.56 545.04 505.86 488.25 641.35 540.49 619.96 572.85 590.88 511.8 578.95 557.91 646.4 636.27 534.61 500.25 624.13 481.51 596.76 568.36 608.57 528.71 630.99 493.63 523.15 517.62 602.95 614.82 563.58
*+ WARNING: !! '-stim_times_AM2 2' file 'stimuli/ATN_003v1_ON_events_test.txt' has no good stimulus time values
++ Number of time points: 12 (no censoring)
 + Number of parameters:  14 [8 baseline ; 6 signal]
** ERROR: Regression model has too many parameters for dataset length :(
** FATAL ERROR: 3dDeconvolve dies: Insufficient data (12) for estimating 14 parameters

If anyone has an idea of why this could be occurring, please let me know, thanks!

Hello Annie,

It is very suspicious that the input has only 12 time points. Maybe it is not what you were planning to provide. The issues stem from that.

The actual error is due to trying to model 14 parameters (6 motion? + 2 polort + 6 stim) with only those 12 time points.

The stimulus timing warnings then stem from having an input time series that only seems to span 11 seconds, but yet having stimulus events going out 10 or 11 minutes.

So everything comes back to having only 12 input time points.

  • rick

Hi Rick, thank you for the reply! Apologies, I am relatively new to fMRI analysis. When you say the error stems from only having 12 input time points, is this referring to the times listed in the events txt file I put on the regress_stim_times line of my afni_proc.py script?

Hi Annie,

It should come from what was passed to afni_proc.py via the -dsets option. Pass a list of EPI datasets, one per run.
Feel free to show part or all of your afni_proc.py command.

  • rick

Hi Rick,
Okay, that makes sense. Here is my afni_proc.py script.

#!/bin/tcsh

afni_proc.py                                                                                                                                            \
            -subj_id                  ATN003v1_ON                                                                                                       \
            -copy_anat                ./AFNI_SS_opt/anatSS.ATN003v1_ON.nii                                                                              \
            -anat_has_skull           no                                                                                                                \
            -anat_follower            anat_w_skull anat ./fMRIdata_DICOMsort/ATN003v1_ON/Nifti/"ATN003v1_ON_T1-M"   \
            -dsets                    ./fMRIdata_DICOMsort/ATN003v1_ON/Nifti/"ATN003v1_ON_MB3_fMRI-12min_b.nii"                                         \
            -blocks                   tshift align tlrc volreg mask blur                                                                                \
                                      scale regress                                                                                                     \
            -radial_correlate_blocks  tcat volreg regress                                                                                               \
            -tcat_remove_first_trs    2                                                                                                                 \
            -align_unifize_epi        local                                                                                                             \
            -align_opts_aea           -cost lpc+ZZ                                                                                                      \
                                      -giant_move                                                                                                       \
                                      -check_flip                                                                                                       \
            -tlrc_base                MNI152_2009_template_SSW.nii.gz                                                                                   \
            -tlrc_NL_warp                                                                                                                               \
            -tlrc_NL_warped_dsets     ./AFNI_SS_opt/anatQQ.ATN003v1_ON.nii                                                                              \
                                      ./AFNI_SS_opt/anatQQ.ATN003v1_ON.aff12.1D                                                                         \
                                      ./AFNI_SS_opt/anatQQ.ATN003v1_ON_WARP.nii                                                                         \
            -volreg_align_to          MIN_OUTLIER                                                                                                       \
            -volreg_align_e2a                                                                                                                           \
            -volreg_tlrc_warp                                                                                                                           \
            -volreg_compute_tsnr      yes                                                                                                               \
            -mask_epi_anat            yes                                                                                                               \
            -blur_size                3.0                                                                                                               \
            -regress_stim_times       ./VDR_data/events/ATN_003v1_ON_events.txt                                                                         \
                                      ./VDR_data/events_test/ATN_003v1_ON_events_test.txt                                                               \
            -regress_stim_types       AM2                                                                                                               \
            -regress_basis            'BLOCK(3,1)'                                                                                                      \
            -regress_opts_3dD         -jobs 8                                                                                                           \
            -regress_motion_per_run                                                                                                                     \
            # -regress_censor_motion    0.3                                                                                                               \
            #-regress_censor_outliers  0.05                                                                                                              \
            -regress_3dD_stop                                                                                                                           \
            -regress_reml_exec                                                                                                                          \
            -regress_compute_fitts                                                                                                                      \
            -regress_make_ideal_sum   "sum_ideal.1D"                                                                                                    \
            -regress_est_blur_epits                                                                                                                     \
            -regress_est_blur_errts                                                                                                                     \
            -regress_run_clustsim     no                                                                                                                \
            -html_review_style        pythonic                                                                                                          \
            -execute

Hi Annie,

What is the output of

3dinfo -n4 fMRIdata_DICOMsort/ATN003v1_ON/Nifti/ATN003v1_ON_MB3_fMRI-12min_b.nii
  • rick

Hi Rick,
Here is the output:
96 96 51 14

-Annie

Hi Annie,

Indeed, this dataset has only 14 time points, I would expect something in the hundreds. Most likely, there is a different dataset that is a full EPI run that should be passed, instead. You should look through the datasets closely, to be sure of what each one is. Running 3dinfo on them should help.

  • rick

Hi Rick,
Thank you for getting back to me on this! That is very odd... I will take a look at the datasets.

-Annie