Newer
Older
#!/bin/sh
# Copyright (C) 2004 University of Oxford
#
# SHCOPYRIGHT
Usage() {
echo ""
echo "Usage: eddy_correct <4dinput> <4doutput> <reference_no>"
echo ""
}
[ "$3" = "" ] && Usage
input=`${FSLDIR}/bin/remove_ext ${1}`
output=`${FSLDIR}/bin/remove_ext ${2}`
ref=${3}
if [ `${FSLDIR}/bin/imtest $input` -eq 0 ];then
echo "Input does not exist or is not in a supported format"
fi
avwroi $input $output $ref 1
avwsplit $input
full_list=`${FSLDIR}/bin/imglob -oneperimage vol*`
for i in $full_list ; do
echo processing $i
echo processing $i >> ${output}.ecclog
${FSLDIR}/bin/flirt -in $i -ref $output -nosearch -o $i -paddingsize 1 >> ${output}.ecclog
done
avwmerge -t $output $full_list
/bin/rm vol*