Resting State

Hi AFNI experts,

I have a question regarding resting state The below is the script I used for the analysis and its from output -help afni -subj_id subj123
-dsets epi_run1+orig.HEAD
-copy_anat anat+orig
-blocks despike tshift align tlrc volreg blur mask regress
-tcat_remove_first_trs 3
-regress_censor_motion 0.2
-regress_censor_outliers 0.1
-regress_bandpass 0.01 0.1
-regress_apply_mot_types demean deriv

From some reason, the result spits out the following fatal error and I am not sure what causes this.

++ 3dDeconvolve extending num_stimts from 12 to 162 due to -ortvec
++ 3dDeconvolve: AFNI version=AFNI_17.1.10 (Jun 6 2017) [64-bit]
++ Authored by: B. Douglas Ward, et al.
++ STAT automask has 161867 voxels (out of 172800 = 93.7%)
++ Skipping check for initial transients
++ Input polort=4; Longest run=474.0 s; Recommended minimum polort=4 ++ OK ++
++ Number of time points: 237 (before censor) ; 111 (after)

  • Number of parameters: 167 [167 baseline ; 0 signal]
    ** FATAL ERROR: 3dDeconvolve dies: Insufficient data (111) for estimating 167 parameters

Could you please advise me what is the issue here?

Thank you in advance,

Hi Jun,

Note the one line from 3dDeconvolve:

++ Number of time points: 237 (before censor) ; 111 (after)

That shows 126 time points were censored.

Between censoring and band passing, all of the degrees of
freedom are lost. For more details about the cost of
band passing, please see the -help output
section “RESTING STATE NOTE” and the “Comment on bandpassing”.

  • rick

Hi, Jun-

The total number of degrees of freedom (DOFs) of your data set initially is your number of points. With every regressor in your model or time point that you censor, one degree of freedom gets used up. 3dDeconvolve is the main function where the regression model gets applied. There are some basic things that get regressed: a few polynomials (your “polort” number above is 4), motion regressors (6 rigid body parameters, possibly also the derivative of each, which is common in resting state analysis, so that would be 12 motion regressors total). 3 initial time points get removed-- so that is three more DOFs gone-- and then it looks like you have a lot of time points censored-- see the line of output:

Number of time points: 237 (before censor) ; 111 (after)

which means that you have 126 points censored-- over half of the data set, which should send some warning chills. And finally, doing bandpassing is also something that eats up degrees of freedom-- in fact, 2 DOF get regressed out for each frequency removed (and exactly how many in total get removed depends on your TR).

In total, by the time the polorts, motion regressors (+derivatives), chopped initial time points, censored time points, and bandpassed frequencies get put into the regression model, the program detects that you are trying to remove more degrees of freedom than what you have to start with. Therein lies the problem.

If you look at your volumes and time series over time, does it look problematic/noisy? That seems to be the part causing the most trouble here.


Good morning Rick and PT,

Thank you so much for the quick response. I reanalyzed based on your comments and it is now working well. I really appreciate your help!