14.2.2. Beynel et al. (2024). Lessons learned from an fMRI-guided rTMS study …

Introduction

Here we present commands used in the following paper:

  • Beynel L, Gura H, Rezaee Z, Ekpo EC, Deng ZD, Joseph JO, Taylor P, Luber B, Lisanby SH (2024). Lessons learned from an fMRI-guided rTMS study on performance in a numerical Stroop task. PLoS One 19(5):e0302660. doi: 10.1371/journal.pone.0302660.

Abstract: The Stroop task is a well-established tool to investigate the influence of competing visual categories on decision making. Neuroimaging as well as rTMS studies have demonstrated the involvement of parietal structures, particularly the intraparietal sulcus (IPS), in this task. Given its reliability, the numerical Stroop task was used to compare the effects of different TMS targeting approaches by Sack and colleagues (Sack AT 2009), who elegantly demonstrated the superiority of individualized fMRI targeting. We performed the present study to test whether fMRI-guided rTMS effects on numerical Stroop task performance could still be observed while using more advanced techniques that have emerged in the last decade (e.g., electrical sham, robotic coil holder system, etc.). To do so we used a traditional reaction time analysis and we performed, post-hoc, a more advanced comprehensive drift diffusion modeling approach. Fifteen participants performed the numerical Stroop task while active or sham 10 Hz rTMS was applied over the region of the right intraparietal sulcus (IPS) showing the strongest functional activation in the Incongruent > Congruent contrast. This target was determined based on individualized fMRI data collected during a separate session. Contrary to our assumption, the classical reaction time analysis did not show any superiority of active rTMS over sham, probably due to confounds such as potential cumulative rTMS effects, and the effect of practice. However, the modeling approach revealed a robust effect of rTMS on the drift rate variable, suggesting differential processing of congruent and incongruent properties in perceptual decision-making, and more generally, illustrating that more advanced computational analysis of performance can elucidate the effects of rTMS on the brain where simpler methods may not.

Study keywords: task-based FMRI, EPI, MPRAGE, human, adult, rTMS

Main programs: afni_proc.py, @SSwarper

Github page:
See these authors’ github page for descriptions and downloads of codes and supplementary text files:

Download scripts

To download, either:

  • ... click the link(s) in the following table (perhaps Rightclick -> “Save Link As…”):

    do_13_ssw.bash

    run @SSwarper for nonlinear alignment to a template, and skullstripping of the subject’s T1w anatomical volume

    do_20_ap_targeting.bash

    run afni_proc.py for task-based FMRI analysis (Stroop task); this uses nonlinear warps estimated with @SSwarper

  • ... or copy+paste into a terminal:

    curl -O https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/codex/fmri/media/2024_BeynelEtal/do_13_ssw.bash
    curl -O https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/codex/fmri/media/2024_BeynelEtal/do_20_ap_targeting.bash
    

View scripts

do_13_ssw.bash

 1#!/bin/bash
 2
 3# ===========================================================================
 4# Name:       do_13_ssw.bash
 5# Author:     LB
 6# Date:       7/12/22
 7
 8# Syntax:     bash do_13_ssw.bash SUBJ
 9# Arguments:  SUBJ: subject ID
10
11# Desc:       This script will run all chosen scans through the 
12#             @SSwarper program for skullstripping (SS) and nonlinear
13#             alignment (warping) of T1w anatomical to a template
14# Req:        1) AFNI
15# Notes:      Run this before afni_proc.py, and provide its outputs there.
16# ===========================================================================
17
18# Biowulf loading
19module load afni
20
21# ------------------------------ get inputs ---------------------------------
22
23if [ "$#" -eq 1 ]; then
24   subj=$1
25else
26   echo "Specify participant ID Please"
27   exit 1
28fi
29
30# ------------------------------ define paths ---------------------------------
31
32pwd_dir=`pwd`
33proj_dir=${pwd_dir%/*}
34
35anatdir=${proj_dir}/Anat/${subj}           # dir with T1w anatomical
36funcdir=${proj_dir}/Func/${subj}           # dir with FMRI/EPI
37stimdir=${proj_dir}/Behav/${subj}          # dir with stim timing files
38analysisdir=${proj_dir}/Analysis/${subj}   # dir with SSW results; output here
39
40MNItemplate=${pwd_dir}/MNI152_2009_template_SSW.nii.gz
41echo "++ Template: ${MNItemplate}"
42
43# --------------------------- check input dsets ------------------------------
44
45# anat
46if [ -f "${anatdir}/${subj}_T1.nii" ] ; then
47cat <<EOF
48++ Found T1 of ${subj}... 
49EOF
50
51else
52cat <<EOF
53++ ** ERROR: This participant does not have T1 scan .. EXITING ++
54EOF
55   exit 1
56fi
57
58# --------------------------- run SSW program ------------------------------
59
60cd ${analysisdir}
61
62@SSwarper                                                                    \
63    -input  ${anatdir}/${subj}_T1.nii                                        \
64    -base   ${MNItemplate}                                                   \
65    -subid  ${subj}                                                          \
66    -odir   ${analysisdir}
67
68exit 0

do_20_ap_targeting.bash

  1#!/bin/bash
  2
  3# ===========================================================================
  4# Name:       do_20_ap_targeting.bash
  5# Author:     LB
  6# Date:       7/12/22
  7
  8# Syntax:     bash do_20_ap_targeting.bash SUBJ
  9# Arguments:  SUBJ: subject ID
 10
 11# Desc:       This script will run all chosen scans through the 
 12#             afni_proc.py pipelining program
 13# Req:        1) AFNI
 14# Notes:       --
 15# ===========================================================================
 16
 17# Biowulf loading
 18module load afni python/3.9
 19
 20# ------------------------------ get inputs ---------------------------------
 21
 22if [ "$#" -eq 1 ]; then
 23   subj=$1
 24else
 25   echo "** Please specify participant ID **"
 26   exit 1
 27fi
 28
 29# ------------------------------ define paths ---------------------------------
 30
 31pwd_dir=`pwd`
 32proj_dir=${pwd_dir%/*}
 33
 34anatdir=${proj_dir}/Anat/${subj}           # dir with T1w anatomical
 35funcdir=${proj_dir}/Func/${subj}           # dir with FMRI/EPI
 36stimdir=${proj_dir}/Behav/${subj}          # dir with stim timing files
 37analysisdir=${proj_dir}/Analysis/${subj}   # dir with SSW results; output here
 38
 39MNItemplate=${pwd_dir}/MNI152_2009_template_SSW.nii.gz
 40echo "++ Template: ${MNItemplate}"
 41
 42cd ${analysisdir}
 43
 44# --------------------------- check input dsets ------------------------------
 45
 46# anat
 47if [ -f "${anatdir}/${subj}_T1.nii" ] ; then
 48cat <<EOF
 49++ Found T1w dset of ${subj} ++
 50EOF
 51
 52else
 53cat <<EOF
 54** ERROR: This participant does not have T1w dset ... EXITING **
 55EOF
 56   exit 1
 57fi
 58
 59# epi
 60if [ -f "${funcdir}/${subj}_Block1.nii" ] ; then
 61cat <<EOF
 62++ Found functional dset for participant ${subj}, moving to next step ++
 63EOF
 64
 65else
 66cat <<EOF
 67** ERROR: Subject ${subj} does not have functional dset(s).
 68   Checked: ${funcdir}/${subj}_Block?.nii
 69   ... EXITING **
 70EOF
 71   exit 1
 72fi
 73
 74# --------------------------- build pipeline ------------------------------
 75
 76### Set up FMRI pipeline with AFNI's afni_proc.py
 77### (need to add fixation and ITI and incorrect as stim)
 78
 79afni_proc.py                                                                 \
 80    -subj_id                  "${subj}"                                      \
 81    -blocks                   tshift align tlrc volreg blur mask scale       \
 82                              regress                                        \
 83    -copy_anat                "${analysisdir}/anatSS.${subj}.nii"            \
 84    -anat_has_skull           no                                             \
 85    -dsets                    "${funcdir}/${subj}"_Block?.nii                \
 86    -tcat_remove_first_trs    2                                              \
 87    -align_opts_aea           -cost lpc+ZZ                                   \
 88                              -giant_move                                    \
 89                              -check_flip                                    \
 90    -anat_uniform_method      unifize                                        \
 91    -align_unifize_epi        local                                          \
 92    -volreg_align_to          MIN_OUTLIER                                    \
 93    -volreg_align_e2a                                                        \
 94    -volreg_tlrc_warp                                                        \
 95    -tlrc_base                "${MNItemplate}"                               \
 96    -tlrc_NL_warp                                                            \
 97    -tlrc_NL_warped_dsets     "${analysisdir}/anatQQ.${subj}.nii"            \
 98                              "${analysisdir}/anatQQ.${subj}.aff12.1D"       \
 99                              "${analysisdir}/anatQQ.${subj}_WARP.nii"       \
100    -volreg_compute_tsnr      yes                                            \
101    -mask_epi_anat            yes                                            \
102    -radial_correlate_blocks  tcat volreg                                    \
103    -regress_est_blur_errts                                                  \
104    -blur_size                4.0                                            \
105    -regress_motion_per_run                                                  \
106    -regress_censor_motion    0.3                                            \
107    -regress_censor_outliers  0.05                                           \
108    -regress_reml_exec                                                       \
109    -regress_3dD_stop                                                        \
110    -regress_stim_types       AM1                                            \
111    -regress_stim_times       "${stimdir}/Congruent_Corr_${subj}.txt"        \
112                              "${stimdir}/Incongruent_Corr_${subj}.txt"      \
113                              "${stimdir}/Incorrect_${subj}.txt"             \
114    -regress_stim_labels      Congruent Incongruent Incorrect                \
115    -regress_basis            'dmBLOCK'                                      \
116    -regress_opts_3dD         -jobs 16                                       \
117                              -gltsym 'SYM: +Incongruent -Congruent'         \
118                              -glt_label 1 Incongruent-Congruent             \
119    -html_review_style        pythonic                                       \
120    -execute
121
122
123exit 0