#!/bin/tcsh #=============================================================== # Start script from Parent directory,'Points' # Verify that the script is being run from the proper directory: #=============================================================== set dir = `pwd` if ( ! -d ED ) then echo "" echo "error: this script must be run from the 'Points' directory" echo "exiting..." echo "" exit endif #=============================================================== # Verify that the 'group_data' directory you're about to create # doesn't already exist: #=============================================================== if ( -e group_data ) then echo "failure: the 'group_data' directory already exists" exit endif #=============================================================== # Begin by making a new directory called 'group_data' #=============================================================== mkdir group_data #=============================================================== # cd into subject ED's directory #=============================================================== cd ED #=============================================================== # make a copy of EDsprg+tlrc dataset. Call it "sample_anat". # Move sample_anat+tlrc.* into group_data directory #=============================================================== 3dcopy EDspgr+tlrc sample_anat+tlrc mv sample_anat+tlrc.* ../group_data #=============================================================== # cd out of ED's directory and up one level to parent directory 'Points' #=============================================================== cd .. #=============================================================== # For each subject, copy their mean irf Talairached datasets into 'group_data' # No need to use '3dcopy' b/c these are being moved to 'group_data' and # just being used for ANOVA. #=============================================================== cp ??/??_??_irf_mean+tlrc.* group_data #=============================================================== # cd into 'group_data' directory and run ANOVA from there... #=============================================================== cd group_data #=============================================================== # build dset list, making sure all files exist #=============================================================== set asets = ( ??_TM_irf_mean+tlrc.HEAD ) set blevels = $#asets # create subject list set subjs = () foreach file ( $asets ) set subj = `echo $file | cut -b 1-2` set subjs = ( $subjs $subj ) end # create dset_opts list, for dataset options set dset_opts = () set atypes = ( TM HM TP HP ) foreach sindex ( `count -digits 1 1 $#subjs` ) foreach level ( 1 2 3 4 ) set dset = $subjs[$sindex]_$atypes[$level]_irf_mean+tlrc set dset_opts = ( $dset_opts -dset $level $sindex $dset ) end end 3dANOVA2 -type 3 \ -alevels 4 \ -blevels $#subjs \ $dset_opts \ -amean 1 TM \ -amean 2 HM \ -amean 3 TP \ -amean 4 HP \ -acontr 1 1 1 1 AllAct \ -acontr -1 1 -1 1 HvsT \ -acontr 1 1 -1 -1 MvsP \ -acontr 0 1 0 -1 HMvsHP \ -acontr 1 0 -1 0 TMvsTP \ -acontr 0 0 -1 1 HPvsTP \ -acontr -1 1 0 0 HMvsTM \ -fa StimEffect \ -bucket AvgANOVAv1 #=============================================================== # end of ht05_script2 #===============================================================