Skip to main content

AFNI Class 04: 09/06/2019

afni_proc.py for Resting and Nonlinear

#!/bin/csh
# Example 11b. Similar to 11, but without FreeSurfer.
# 3dcalc -a /rpool/apps/AFNI/abin_201710/TT_desai_dd_mpm+tlrc -expr 'amongst(a,152,170)' -prefix template_ventricle
# 3dresample -dxyz 4 4 4 -inset template_ventricle+tlrc -prefix template_ventricle_4mm.nii.gz
# Be explicit with 2.5mm, using '-volreg_warp_dxyz 2.5'.
# Use template TT_N27+tlrc, to be aligned with the desai atlas.
# No -anat_follower options, but use -mask_import to import the
# template_ventricle_2.5mm dataset (and call it Tvent).
# Use -mask_intersect to intersect ventricle mask with the subject's
# CSFe mask, making a more reliable subject ventricle mask (Svent).
# Ventrile principle components are created as per-run regressors.
# Make WMe and Svent correlation volumes, which are just for
# entertainment purposes anyway.
# Run the cluster simulation.

afni_proc.py -subj_id VNS_01RS_fm_NL_RSFC \
-blocks despike tshift align tlrc volreg mask blur regress \
-copy_anat VNS_01.nii.gz -dsets VNS_01RestingVNS_fm.nii.gz \
-tcat_remove_first_trs 2 -align_opts_aea -cost lpc+ZZ \

-tlrc_base MNI_avg152T1+tlrc -tlrc_NL_warp -volreg_align_to MIN_OUTLIER -volreg_align_e2a \
-volreg_tlrc_warp -volreg_warp_dxyz 4 -mask_segment_anat yes -mask_segment_erode yes \
-mask_import Tvent /rpool/home/asimmons/data/VNS1/AFNI_RS/file/template_ventricle_4mm.nii.gz \
-mask_intersect Svent CSFe Tvent -blur_to_fwhm -blur_size 6 -blur_in_mask yes -regress_motion_per_run \
-regress_ROI_PC Svent 3 -regress_ROI_PC_per_run Svent \
-regress_make_corr_vols WMe Svent \
-regress_anaticor_fast -regress_censor_outliers 0.1 \
-regress_apply_mot_types demean deriv \
-regress_est_blur_epits -regress_est_blur_errts \
-regress_RSFC -regress_bandpass 0.01 0.1 \
-regress_run_clustsim yes

Which creates: proc.VNS_01RS_fm_NL_RSFC
NL with task and @SSwarper:
first strip data:
@SSwarper ${subj}.nii.gz ${subj}
then you can add to your afni_proc.py the following:
-tlrc_NL_warp -tlrc_NL_warped_dsetsanatQQ.${subj}.niianatQQ.aff12.1DanatQQ.${subj}_WARP.nii
an example of a proc script:

proc_afni_SID_fix_motion