#!/bin/tcsh # analyze all subjects using afni_proc.py (scripts/cmd.ap.general) # do not assume any groups to begin with set ap_script = scripts/cmd.ap.general set anat_files = ( input_data/anat*.nii.gz ) set nsubj = $#anat_files echo "== will analyze $nsubj subjects" foreach index ( `count -digits 1 1 $nsubj` ) # grab the SID from the anat dataset name set sid = `echo $anat_files[$index] | cut -b 17-24` echo "processing $sid ($index of $nsubj)..." # do the work tcsh $ap_script $sid end