Speckles in vstat - Hariri faces task


I’ve been trying to pre-process some pilot data from a Hariri faces task (alternating blocks of shapes and faces).

I’ve used the following to generate a script:
module load afni/21.1.07
module load anaconda/3.8

afni_proc.py -blocks despike tshift align tlrc volreg blur mask scale regress -copy_anat t1.nii.gz -anat_has_skull yes -dsets hariri.nii.gz -tcat_remove_first_trs 2 -align_opts_aea -cost nmi -skullstrip_opts -push_to_edge -tlrc_base MNI152_T1_2009c+tlrc -tlrc_NL_warp -volreg_align_to MIN_OUTLIER -volreg_align_e2a -volreg_tlrc_warp -mask_epi_anat yes -mask_segment_anat yes -mask_segment_erode yes -blur_size 6 -blur_in_mask yes -regress_bandpass 0.01 0.1 -regress_ROI WMe CSF -regress_stim_times stim_t_shapes stim_t_faces -regress_stim_labels shapes faces -regress_motion_per_run -regress_censor_motion 0.3 -regress_censor_outliers 0.05 -regress_apply_mot_types demean deriv -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

I’ve also removed the -tzero 0 part and added the following to the 3dTshift bit:
-TR 2.0s -tpattern seqminus

When checking the QC report, I noticed that there are only speckles in the vstat image (attached). The subject didn’t move much (only volumes 2 and 3 were censored), they didn’t fall asleep and they did the task correctly. Therefore, I expected to see something substantial in the visual areas, but alas…

I’ve also attached an image of the regressors and the warning that I got.

I’m not exactly sure what I’m doing wrong, so any help would be highly appreciated!


Hi Misho,

It seems likely that something is not correct with the timing of the task, such as accounting for pre-steady state volumes.

Do the time series initially contain pre-SS volumes?
Do the stim times start at the beginning of pre-SS, or after?
Did you make any adjustments to the stimulus timing to account for pre-SS?
If you need to tell 3dTshift that the TR is 2s, maybe it is not correct in the headers, in which case 3dDeconvolve will not know either.
What does 3dinfo -tr show for those time series?

Smaller points:
I see you are telling afni_proc.py to remove the first 2 time points, which is only 4s of data. Typically it 7-10 s.
With TR=2s, such bandpassing will consume 60% of the degrees of freedom. It is generally not recommended, particularly in the case of task.
That might end up devouring some of the variance of those long, slow blocks, too.

  • rick

Hi Rick,

Yes, they do contain pre-SS volumes. I usually get rid of the first 10 or so TRs when I’m working with resting-state data, but I didn’t want to remove too large of a chunk from the first block. However, I should probably remove 3-4 TRs instead of 2, as you say.

I’ve adjusted the stimulus timings, so that, e.g., if the first one is at 7 seconds, I subtract 4 seconds (=2 TRs) and end up with 3 seconds.

3dinfo -tr does return 2.0.

Ah, yes, I’m too used to resting-state pre-processing… It seems like using a high-pass filter would be preferable!



I’ve re-run the pipeline with the following changes:
I’ve removed the first 4 TRs (=8sec).
I’ve changed the filter bounds to 0.008 and inf.
I’ve re-adjusted the stimulus times as described in the previous post (this time subtracting 8 seconds, of course).

The QC report seems very, very similar to the previous one, though I have plenty of DFs now.
I’m even more confused now :smiley:

You mentioned a first stimulus at time 7s as an example. Is that the actual first event time? If not, what is it (before any adjustments)?

Do you know how to run instacorr on the errts time series? If so, it might be good to verify that a seed in the visual area produces massive correlations, which it seems like your task should lead to.

At any rate, what is the first unadjusted stim event time?

  • rick


A sidenote-level comment here:
As of Jan 20, 2022 (and I think >=AFNI_22.0.04), there the APQC HTML’s vstat block should contain up to 5 statistic/stimuli images. Thus, if you are “only” seeing full F-stat, I suspect that with a more modern AFNI, you would see several Coef+stat images in the vstat block—this might help provide more information. E.g., if the visual cortex should be strrooongly associated with a particular stimulus, and that doesn’t show up, perhaps the subject fell asleep?

I mention this because it appears like you only have Full Fstat in your vstat section (as I see a silver line at the bottom of the image, denoting the next block).

Of course, this might not resolve the issue here—but it should be a more informative QC, anyways.


Hi Rick and Paul!

Thank you for all the tips!

I did try the latest AFNI version and the QC report is indeed even more helpful!.. Unfortunately, the Coef+stat images are also only showing diffuse speckles here and there. ; ( [I’m absolutely certain the subject didn’t fall asleep and did the task correctly.]

I’ve tried running instacorr, but setting the seed doesn’t work for me. Nothing obvious happens when I click on “InstaCorr Set”. When I try to set the seed overlay in the “FIM→Pick Ideal” menu, there isn’t a A_ICOR.1D file.

Re: the stimulus times, the first unadjusted stimulus event time is at 2s… then at 7s, 12s, 17s etc. So, if I remove 4TRs (=8s), I would remove the first 2 times (at 2s and 7s) and adjust all subsequent times by subtracting 8s, i.e. 12s would become 4s, 17s would become 9s etc. Is that the correct way of doing it?