setenv LD_LIBRARY_PATH .:/sw/mvis/bin/${HOSTTYPE}:$LD_LIBRARY_PATH
#   -or-
setenv LD_LIBRARY_PATH .:/d/bigdaily/sw/mvis-2.5/bin/sun4:/usr/openwin/lib

setenv PATH .:/d/bigdaily/sw/mvis-2.5/bin/sun4:$PATH

# cd to a work directory

cd /sw/tmp
cd /d/bigdaily/sw/tmp

# pose-gun | dual-tp-display ~/data/ct.vf ~/data/mr_pd.vf 1
# <pose <m3x1 	20 -40 -10 > <Q 0.995247 0.0870728 -0.00380168 -0.0434534>>

echo "<pose <m3x1 	20 -40 -10 > <Q 0.995247 0.0870728 -0.00380168 -0.0434534>>" > start-pose

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

cp ~/data/mr_pd.vf fixed.1
cp ~/data/ct-small.vf moving.1

smooth-3d -x fixed.1 fixed.2
smooth-3d -x fixed.2 fixed.3
smooth-3d fixed.3 fixed.4

smooth-3d -x moving.1 moving.2
smooth-3d -x moving.2 moving.3
smooth-3d moving.3 moving.4

# get a starting pose...
# pose-gun | dual-tp-display fixed.1 moving.1 1

tp-display moving.4 1

setenv PARAMDIR /d/bigdaily/sw/mvis-2.5/reg/experiments/params

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

dual-tp-display fixed.1 moving.1 1 < pose.1

congruent-volume moving.1 fixed.1 pose.1 moving-ref.1

mix-volumes 4 fixed.1 moving-ref.1 mixed.1
tp-display mixed.1 .5
