3dDeconvove dies while running afni_proc.py

AFNI version info (afni -ver): AFNI_23.2.11
Hello AFNI experts! I have run into an error while trying to run afni_proc.py. This error is specific to the portion of the script running 3dDeconvolve.

Here is the error:

++ ** -stim_times NOTE ** guessing GLOBAL times if 1 time per line; LOCAL otherwise
++ ** GUESSED ** -stim_times_AM2 1 using LOCAL times
*+ WARNING: '-stim_times_AM2 1' file 'stimuli/ATN_001v1_ON_events.txt' has 2 rows, but dataset has 1 time blocks
++ '-stim_times_AM2 1' average amplitude#1=-0.1
++ '-stim_times_AM2 1' average amplitude#2=0.505
++ '-stim_times_AM2 1' average amplitude#3=3
++ Number of time points: 729 (before censor) ; 6 (after)
 + Number of parameters:  16 [12 baseline ; 4 signal]
** ERROR:  *** Censoring has made regression impossible :( ***
** FATAL ERROR: 3dDeconvolve dies: Insufficient data (6) for estimating 16 parameters
** Program compile date = Sep 26 2023
-- applying input view as +orig
** warning: removing first 2 TRs from beginning of each run
   --> the stimulus timing files must reflect the removal of these TRs
-- template = 'MNI152_2009_template_SSW.nii.gz', exists = 1
-- will use min outlier volume as motion base
-- including default: -find_var_line_blocks tcat
-- tcat: reps is now 729
++ updating polort to 5, from run len 729.0 s
-- importing NL-warp datasets
-- volreg: using base dset vr_base_min_outlier+orig
** have NL warp to standard space, but not applying to EPI
   (consider -volreg_tlrc_warp)
++ volreg: applying volreg/epi2anat xforms to isotropic 2 mm voxels
-- applying anat warps to 1 dataset(s): ATN001v1_ON_T1-MPRAGE-8min_20211223085844_301
++ mask: using epi_anat mask in place of EPI one
-- have 1 ROI dict entries ...
** warnings for local stim_times format of file ./VDR_data/events/ATN_001v1_ON_events.txt
   - 2 rows does not match 1 runs
++ creating new stim labels: ['stim01']
-- classes have multiple regressors, so not making ideals
-- using default: will not apply EPI Automask
   (see 'MASKING NOTE' from the -help for details)

-------------------------------------
** warning have only 1 run to analyze
-------------------------------------

Here is my script:

#!/bin/tcsh

afni_proc.py                                                                                                                                            \
            -subj_id                  ATN001v1_ON                                                                                                       \
            -copy_anat                ./AFNI_SS_opt/ATN001v1_ON/anatSS.ATN001v1_ON.nii                                                                  \
            -anat_has_skull           no                                                                                                                \
            -anat_follower            anat_w_skull anat ./fMRIdata_DICOMsort/ATN001v1_ON/Nifti/"ATN001v1_ON_T1-MPRAGE-8min_20211223085844_301.nii.gz"   \
            -dsets                    ./fMRIdata_DICOMsort/ATN001v1_ON/Nifti/"ATN001v1_ON_MB3_fMRI-12min_Series0601_C.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/ATN001v1_ON/anatQQ.ATN001v1_ON.nii                                                                  \
                                      ./AFNI_SS_opt/ATN001v1_ON/anatQQ.ATN001v1_ON.aff12.1D                                                             \
                                      ./AFNI_SS_opt/ATN001v1_ON/anatQQ.ATN001v1_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_001v1_ON_events.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

I am not quite sure why 3dDeconvolve is quitting. Along with this, the AM2 stim times txt file I input into the script has the times for both run 1 and run 2. However, it is only analyzing run 1. My guess is that it is only analyzing run 1 because the scanner stayed on for the entire task and did not stop and start again for run 2.

Please let me know if you have suggestions on what could be the issue and how to fix it. Thank you!

Hi-

I see these lines in the output:

** ERROR:  *** Censoring has made regression impossible :( ***
** FATAL ERROR: 3dDeconvolve dies: Insufficient data (6) for estimating 16 parameters
** Program compile date = Sep 26 2023

That means there aren't enough degrees of freedom for the regression model to work at the end.

When in the input time series has N time points, that means there are N degrees of freedom (DFs). For every regressor in the model, 1 DF gets used up. Each time point of censoring also uses up 1 DF.

--pt

Got it, thank you so much!