Dear AFNI Experts,
I have inherited SPM-preprocessed EPI images for a resting-state analysis. These images have already undergone bandpass filtering, but NOT the removal of other nuisance regressors. I have the following text files (.txt) for each participant containing the 1) motion parameters, 2) global white matter signal, 3) global CSF signal, 4) global brain signal, and 5) censored TRs.
I would like to remove these nuisance regressors using AFNI’s 3dDeconvolve, but have typically used proc.py for this in the past, and not sure if 3dDeconvolve is the most appropriate program to handle all of these? Below is my sample code, could you please let me know if this looks reasonable, or if there might be a more appropriate method. I plan to use the resulting errts file for the remaining analysis.
3dDeconvolve -input rs.nii
-mask brainMask_RS.nii.gz
-censor censor.txt
-polort 1
-num_stimts 9
-stim_file 1 motion.txt’[0]’ -stim_base 1 -stim_label 1 roll
-stim_file 2 motion.txt’[1]’ -stim_base 2 -stim_label 2 pitch
-stim_file 3 motion.txt’[2]’ -stim_base 3 -stim_label 3 ya
-stim_file 4 motion.txt’[3]’ -stim_base 4 -stim_label 4 ds
-stim_file 5 motion.txt’[4]’ -stim_base 5 -stim_label 5 dl
-stim_file 6 motion.txt’[5]’ -stim_base 6 -stim_label 6 dp
-stim_file 7 csf.txt’[0]’ -stim_base 7 -stim_label 7 csf
-stim_file 8 wm.txt’[0]’ -stim_base 8 -stim_label 8 wm
-stim_file 9 global.txt’[0]’ -stim_base 8 -stim_label 9 gl
-fitts rs_fitts -errts rs_errts -bucket rs_all
-jobs 2
Your advice is very much appreciated,
Alfonso
I’ve tested the code and this is the output displayed in the Terminal window (below). The resulting rs_errts image looks fine, but I am wondering if additional processing is necessary? For example, executing the 3dREMLfit command?
++ 3dDeconvolve: AFNI version=AFNI_21.0.00 (Jan 7 2021) [64-bit]
++ Authored by: B. Douglas Ward, et al.
++ loading dataset rs_f.nii
++ Skipping check for initial transients
++ Input polort=1; Longest run=140.0 s; Recommended minimum polort=1 ++ OK ++
++ Number of time points: 140 (before censor) ; 122 (after)
- Number of parameters: 11 [10 baseline ; 1 signal]
++ total shared memory needed = 1,018,165,512 bytes (about 1.0 billion)
++ mmap() memory allocated: 1,018,165,512 bytes (about 1.0 billion)
++ Memory required for output bricks = 1,018,165,512 bytes (about 1.0 billion)
++ Wrote matrix values to file rs_all.xmat.1D
++ ========= Things you can do with the matrix file =========
++ (a) Linear regression with ARMA(1,1) modeling of serial correlation:
3dREMLfit -matrix rs_all.xmat.1D -input rs_f.nii
-mask brainMask_RS.nii.gz -Rbuck rs_all_REML -Rvar rs_all_REMLvar
-Rfitts rs_fitts_REML -Rerrts rs_errts_REML -verb
++ N.B.: 3dREMLfit command above written to file rs_all.REML_cmd
++ (b) Visualization/analysis of the matrix via ExamineXmat.R
++ (c) Synthesis of sub-model datasets using 3dSynthesize
++ ==========================================================
++ ----- Signal+Baseline matrix condition [X] (122x11): 2.28984 ++ VERY GOOD ++
++ ----- Signal-only matrix condition [X] (122x1): 1 ++ VERY GOOD ++
++ ----- Baseline-only matrix condition [X] (122x10): 1.95927 ++ VERY GOOD ++
++ ----- stim_base-only matrix condition [X] (122x8): 1.92574 ++ VERY GOOD ++
++ ----- polort-only matrix condition [X] (122x2): 1.04606 ++ VERY GOOD ++
++ +++++ Matrix inverse average error = 5.196e-14 ++ VERY GOOD ++
++ Matrix setup time = 0.01 s
++ Voxels in dataset: 902629
++ Voxels in mask: 263820
++ Voxels per job: 131910
++ Job #1: processing voxels 393706 to 902628; elapsed time=2.650
++ Job #0: processing voxels 0 to 393705; elapsed time=2.662
++ voxel loop:0123456789.0123456789.0123456789.0123456789.0123456789.
++ Job #0 waiting for children to finish; elapsed time=6.085
++ Job #1 finished; elapsed time=6.328
++ Job #0 now finishing up; elapsed time=6.351
++ Smallest FDR q [0 Full_Fstat] = 3.06458e-14
++ Wrote bucket dataset into ./rs_all+tlrc.BRIK
- created 1 FDR curves in bucket header
++ Wrote 3D+time dataset into ./rs_fitts+tlrc.BRIK
++ Wrote 3D+time dataset into ./rs_errts+tlrc.BRIK
++ Program finished; elapsed time=19.734