
setenv TMP  /export/suede/surg

setenv MVIS /export/suede/sw/mvis-2.6

setenv PATH ${MVIS}/bin/${HOSTTYPE}:$PATH
setenv LD_LIBRARY_PATH .:${MVIS}/bin/${HOSTTYPE}:${PATH}:/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xil/lib

cd $TMP


% mrml-to-vf /d/develop/projects/slicer/spect2mrt1.mrml mrt.vf
% mrml-to-vf /d/develop/projects/slicer/spect2spgr.mrml spgr.vf

% mrml-to-vf /export/suede/sw/mvis-2.6/mrml/spgr.mrml goo

mrml-to-vf /export/suede/surg/sandydown.mrml spgr.vf
mrml-to-vf /export/suede/surg/sandymrt.mrml mrt.vf

tp-display mrt.vf 1
tp-display spgr.vf 1

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

smooth-vol -yz fixed.1 fixed.2
smooth-vol -xyz fixed.2 fixed.3
smooth-vol -xyz fixed.3 fixed.4

smooth-vol -yz moving.1 moving.2
smooth-vol -yz moving.2 moving.3
smooth-vol -xyz moving.3 moving.4

#pose-gun | dual-tp-display spgr.vf mrt.vf 1

pose-gun | dual-tp-display spgr.vf mrt.vf .7

# echo "<pose <m3x1 	0 -80.2606 -28.1908 > <Q 0.981061 -0.172987 -0.0151344 -0.0858317>>" > start-pose

# echo "<pose <m3x1 	40 50 0 > <Q 0.999048 0 0.0436194 0>>" > start-pose

echo "<pose <m3x1 	-94.8236 0 -49.3185 > <Q 0.982963 -0.12941 -0.12941 -0.0170371>>" > start-pose

echo "<pose <m3x1 	-95.2948 -1.26076 -44.6121 > <Q 0.984808 -0.0449435 -0.167731 1.86265e-08>>" > start-pose

cp ~sw/etc/null-pose start-pose

invert-pose < start-pose > start-pose-2





reg-3d-i $MVIS/reg/experiments/params/ctmr-reg-params.4 < start-pose-2 > pose.4
reg-3d-i $MVIS/reg/experiments/params/ctmr-reg-params.3 < pose.4 > pose.3
reg-3d-i $MVIS/reg/experiments/params/ctmr-reg-params.2 < pose.3 > pose.2
reg-3d-i $MVIS/reg/experiments/params/ctmr-reg-params.1 < pose.2 > pose.1

# 
echo "<pose <m3x1 	-97.0386 -2.89993 -45.4388 > <Q 0.981779 -0.123598 -0.139638 -0.0365331>>" > man-pose
echo "<pose <m3x1 	-91.3429 -2.02336 -43.4919 > <Q 0.974753 -0.125074 -0.18233 -0.031107>>" > man-pose-2
pose-gun man-pose | dual-tp-display spgr.vf mrt.vf .7

reg-3d-i $MVIS/reg/experiments/params/ctmr-reg-params.3 < man-pose > pose.3
reg-3d-i $MVIS/reg/experiments/params/ctmr-reg-params.2 < pose.3 > pose.2
reg-3d-i $MVIS/reg/experiments/params/ctmr-reg-params.1 < pose.2 > pose.1




pose-to-trans  < man-pose-2 > trans.1

invert-pose < pose.1 | pose-to-trans > trans.2

cat trans.1

rm mrt.* spgr.* fixed.* moving.*
