setenv MVIS /usr/sw/mvis-2.7
setenv TMP /tmp

setenv BIN ${MVIS}/bin/${HOSTTYPE}
setenv LD_LIBRARY_PATH .:${BIN}:$LD_LIBRARY_PATH
setenv PATH ${BIN}:${PATH}

cd $TMP

mrml-to-vf ${MVIS}/mrml/reg-mit.t 2 spgr.vf
mrml-to-vf ${MVIS}/mrml/reg-mit.t 1 mrt.vf

ln -s spgr.vf fixed.1
ln -s mrt.vf moving.1

smooth-vol -a fixed.1 fixed.2
smooth-vol -a fixed.2 fixed.3
smooth-vol -a fixed.3 fixed.4

smooth-vol -a moving.1 moving.2
smooth-vol -a moving.2 moving.3
smooth-vol -a moving.3 moving.4


setenv PARAMDIR ${MVIS}/reg/experiments/params

#cp ~/etc/null-pose start-pose
pose-gun | dual-tp-display fixed.1 moving.1 1 > start-pose
#echo "<pose <m3x1 	0 60 50 > <Q 0.996195 -0.0871557 0 0>>" > start-pose
#echo "<pose <m3x1 	0 60 30 > <Q 0.984808 -0.173648 0 0>>" > start-pose-bad
# 
#
pose-gun | dual-tp-display fixed.1 moving.1 1 > start-pose-real-bad


echo "<pose <m3x1 	0 20 20 > <Q 1 0 0 0>>" > start-pose-real-bad

#cp ~/etc/null-pose start-pose-real-bad

reg-3d-i $PARAMDIR/new-params.4 < start-pose-bad > pose.4
reg-3d-i $PARAMDIR/new-params.3 < pose.4 > pose.3
reg-3d-i $PARAMDIR/new-params.2 < pose.3 > pose.2
reg-3d-i $PARAMDIR/new-params.1 < pose.2 > pose.1

invert-pose < pose.1 > pose.alt

pose-to-trans < pose.1 > trans.1
pose-to-trans < pose.alt > trans.alt
