#L nACC
# extract timecourse of L nACC
3dmaskave -quiet -mask ../../Zach_ROIs_onepointfive.nii -mrange 43 44 $1.Entropy.Mood_MOTIONpreprocessed/ANTified_errts_onepointfive.nii.gz > bilat_nACC_timecourse15.txt
#Enforce a TR structure on the data (IMPORTANT!!! Otherwise 3dfim+ in the next step will barf)
3drefit -TR 2.0 $1.Entropy.Mood_MOTIONpreprocessed/ANTified_errts_onepointfive.nii.gz
#Create functional connectivity map
3dfim+ -input $1.Entropy.Mood_MOTIONpreprocessed/ANTified_errts_onepointfive.nii.gz -polort 0 -ideal_file bilat_nACC_timecourse15.txt -out Correlation -bucket bilat_nACC_Corr15
# convert to z scores
3dcalc -a bilat_nACC_Corr15+orig. -expr 'log((1+a)/(1-a))/2' -prefix $1.Entropy.Mood_MOTIONpreprocessed/bilat_nACC_Corr15map_z