Preprocessing help

Hello there,

I am brand new to AFNI and trying to replicate a script someone else has created. I keep running into an error that says my datasets are missing even though I have specified them (I think). Would you mind taking a look? Below is the script I created and the output I get. Thanks so much!

#!/usr/bin/env tcsh

set subject and group identifiers

set subj = sub-08
set gname = Flanker

set data directories

set top_dir = Users/Nadia/Desktop/${gname}/sub-08
set anat_dir = $top_dir/anat
set epi_dir = $top_dir/func

#run afni_proc.py

afni_proc.py -subj_id $subj
-blocks tshift align tlrc volreg blur mask scale
-copy_anat $anat_dir/sub-08_T1w.nii.gz
-dsets
$epi_dir/sub-08_task-flanker_run-1_bold.nii.gz
$epi_dir/sub-08_task-flanker_run-2_bold.nii.gz
-tcat_remove_first_trs 0
-align_opts_aea -giant_move
-tlrc_base MNI_avg152T1+tlrc
-volreg_align_to MIN_OUTLIER
-volreg_align_e2a
-volreg_tlrc_warp
-blur_size 4.0 \

Nadias-MacBook-Air:sub-08 Nadia$ tcsh -x sub-08.proc
set subj = sub-08
set gname = Flanker
set top_dir = Users/Nadia/Desktop/Flanker/sub-08
set anat_dir = Users/Nadia/Desktop/Flanker/sub-08/anat
set epi_dir = Users/Nadia/Desktop/Flanker/sub-08/func
afni_proc.py -subj_id sub-08 -blocks tshift align tlrc volreg blur mask scale -copy_anat Users/Nadia/Desktop/Flanker/sub-08/anat/sub-08_T1w.nii.gz -dsets Users/Nadia/Desktop/Flanker/sub-08/func/sub-08_task-flanker_run-1_bold.nii.gz Users/Nadia/Desktop/Flanker/sub-08/func/sub-08_task-flanker_run-2_bold.nii.gz -tcat_remove_first_trs 0 -align_opts_aea -giant_move -tlrc_base MNI_avg152T1+tlrc -volreg_align_to MIN_OUTLIER -volreg_align_e2a -volreg_tlrc_warp -blur_size 4.0
** missing run 1 dataset: Users/Nadia/Desktop/Flanker/sub-08/func/sub-08_task-flanker_run-1_bold.nii.gz
** missing run 2 dataset: Users/Nadia/Desktop/Flanker/sub-08/func/sub-08_task-flanker_run-2_bold.nii.gz

** failed command (create_blocks):

afni_proc.py -subj_id sub-08 -blocks tshift align tlrc volreg blur mask
scale -copy_anat
Users/Nadia/Desktop/Flanker/sub-08/anat/sub-08_T1w.nii.gz -dsets
Users/Nadia/Desktop/Flanker/sub-08/func/sub-08_task-flanker_run-1_bold.nii.gz
Users/Nadia/Desktop/Flanker/sub-08/func/sub-08_task-flanker_run-2_bold.nii.gz
-tcat_remove_first_trs 0 -align_opts_aea -giant_move -tlrc_base
MNI_avg152T1+tlrc -volreg_align_to MIN_OUTLIER -volreg_align_e2a
-volreg_tlrc_warp -blur_size 4.0

Hi-

Some things to note:

A) In your script, in this line near the top, should there be a “/” before “Users”?


set top_dir = Users/Nadia/Desktop/${gname}/sub-08

You will have a better idea of being right if you see datasets output with:


ls  /Users/Nadia/Desktop/Flanker/sub-08/sub-08_task-flanker_run-?_bold.nii.gz

for example.

B1) Have you truncated the afni_proc.py command?
B2) I’m a bit curious why there is no “regress” block for any kind of modeling.
B3) I also see the last line has a continuation of line character at the end…

C) We recommend doing some different things now, such as performing nonlinear alignment and skullstripping beforehand with @SSwarper (skullstripping + warping), and then providing the results for afni_proc.py to use-- we have examples of that in the help, and/or we can make suggestions here.

D) We would recommend adding “-check_flip” after "-align_opts_aea, so that


-align_opts_aea -giant_move \

—>


-align_opts_aea -giant_move -check_flip \

The reason for this is described in this fun work:
https://www.frontiersin.org/articles/10.3389/fninf.2020.00018/full

E) We’d probably also recommending adding this, as something that helps QC motion effects before/after processing


-radial_correlate_blocks tcat volreg                     \

F) We’d really recommend adding:


-html_review_style pythonic

… so you get hte nicer QC stuff. See here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/apqc_html/main_toc.html

–pt