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
|
#!/bin/bash
#
# runelastixlinux
#
# Script to run elastix on linux when the
# libANNlib.so cannot be found.
#
# Usage:
#
# runelastixlinux ...
#
# with ... referring to all arguments you normally
# would use for elastix.
#
# find elastix executable that is used
whichelastix=`which elastix`
# extract the path to elastix
#
# ${string%substring}
# strips shortest match of $substring from back of $string.
elastixpath=${whichelastix%/elastix}
# add the path temporarily to the LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$elastixpath:$LD_LIBRARY_PATH
# run elastix with the supplied command-line arguments
elastix $*
# after exitting this script, the LD_LIBRARY_PATH is
# automatically as it was before running this script.
|