Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Copyright (C) 2004 University of Oxford
#
# SHCOPYRIGHT
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` -eq 0 ];then
echo "Input does not exist or is not in a supported 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 -paddingsize 1 >> ${output}.ecclog
done
avwmerge -t $output $full_list
/bin/rm vol*