Skip to content
Snippets Groups Projects
Commit 30584c97 authored by Saad Jbabdi's avatar Saad Jbabdi
Browse files

change output name

parent a302757f
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
if [ "$2" == "" ];then if [ "$2" == "" ];then
echo "" echo ""
echo "Usage: rotate_bvecs <ecclogfile> <bvecs>" echo "Usage: rotate_bvecs <ecclogfile> <bvecs>"
echo "will save bvecs file into <bvecs>_old and create new bvecs file called <bvecs>" echo "used to update bvecs based on eddy correction"
echo "will create a new bvecs file called <bvecs>_rot"
echo "" echo ""
exit 1 exit 1
fi fi
...@@ -11,22 +12,21 @@ fi ...@@ -11,22 +12,21 @@ fi
ecclog=$1 ecclog=$1
bvecs=$2 bvecs=$2
if [ -f ${bvecs}_old ];then if [ -f ${bvecs}_rot ];then
echo "" echo ""
echo "Error: Found that ${bvecs}_old already exists" echo "Error: Found that ${bvecs}_rot already exists"
echo "This probably means that you have run this script before. Be aware that this also means ${bvecs} have already been rotated!" echo "This probably means that you have run this script before."
echo "If you want to force this program to run, please remove the file ${bvecs}_old" echo "To get this program to run, please remove the file ${bvecs}_rot"
echo "" echo ""
exit 1 exit 1
fi fi
/bin/cp ${bvecs} ${bvecs}_old
#/bin/rm -f ${bvecs}
# this only works if the bvecs are in lines... # this only works if the bvecs are in lines...
Xs=$(cat ${bvecs}_old | head -1 | tail -1) Xs=$(cat ${bvecs} | head -1 | tail -1)
Ys=$(cat ${bvecs}_old | head -2 | tail -1) Ys=$(cat ${bvecs} | head -2 | tail -1)
Zs=$(cat ${bvecs}_old | head -3 | tail -1) Zs=$(cat ${bvecs} | head -3 | tail -1)
rnd=${$} rnd=${$}
cat ${ecclog} | while read line; do cat ${ecclog} | while read line; do
...@@ -96,7 +96,7 @@ for matfile in /tmp/grot${rnd}_*.mat;do ...@@ -96,7 +96,7 @@ for matfile in /tmp/grot${rnd}_*.mat;do
i=$(echo "$i + 1" | bc) ; i=$(echo "$i + 1" | bc) ;
done done
echo "$rXs" > ${bvecs}; echo "$rXs" > ${bvecs}_rot;
echo "$rYs" >> ${bvecs}; echo "$rYs" >> ${bvecs}_rot;
echo "$rZs" >> ${bvecs}; echo "$rZs" >> ${bvecs}_rot;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment