-
Stephen Smith authoredStephen Smith authored
eddy_correct 673 B
#!/bin/sh
Usage() {
echo ""
echo "Usage: eddy_correct <4dinput> <4doutput> <reference_no>"
echo ""
exit
}
[ "$3" = "" ] && Usage
input=`${FSLDIR}/bin/remove_ext ${1}`
output=`${FSLDIR}/bin/remove_ext ${2}`
ref=${3}
if [ ! `${FSLDIR}/bin/imtest $input` ];then
echo "Input does not exist or is not in analyze format"
exit
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 >> ${output}.ecclog
done
avwmerge -t $output $full_list
/bin/rm vol*