cp `dirname ${2}`/`basename ${2} .hdr`.hdr ${1}/a.hdr cp `dirname ${2}`/`basename ${2} .hdr`.img ${1}/a.img cp `dirname ${3}`/`basename ${3} .hdr`.hdr ${1}/b.hdr cp `dirname ${3}`/`basename ${3} .hdr`.img ${1}/b.img #align all pairs for VAL in a b do for MAL in a b do /ifs/woods/AIR/alignlinear ${1}/$VAL ${1}/$MAL ${1}/${MAL}.air${VAL} -m 6 -b1 8 8 8 -b2 8 8 8 -t1 180 -t2 180 -v -x 3 -g ${1}/${MAL}_${VAL}.init -gs ${1}/${MAL}_${VAL}.inits /ifs/woods/AIR/alignlinear ${1}/$VAL ${1}/$MAL ${1}/${MAL}.air${VAL} -m 6 -b1 2 2 2 -b2 2 2 2 -t1 180 -t2 180 -v -x 3 -f ${1}/${MAL}_${VAL}.init -fs ${1}/${MAL}_${VAL}.inits done done #reconcile /ifs/woods/AIR/reconcile_air 30 ${1}/ .air null ${1}/ rec n a b #define optimal space /ifs/woods/AIR/definecommon_air ${1}/ .airarec ${1}/ .aircommon n a b #create output mean image /ifs/woods/AIR/resliced_mean ${1}/`basename ${1}`_mean 2 ${1}/*.aircommon -k -n 10 #rm ${1}/a.??? #rm ${1}/b.??? #put the following on the command line (example): foreach x (/ifs/schizo/ChildOCD2/P000_TESTSUB) #qsub -b y -q short.q /ifs/schizo/ChildOCD2/scan_reg_2av_cranium.txt ${x} ${x}/ANALYZE/*/MPRAGE*/*.hdr #end #mkdir average_files #mv a*.* average_files #mv b*.* average_files