-
Notifications
You must be signed in to change notification settings - Fork 1
/
upsample_image.sh
executable file
·49 lines (40 loc) · 1.66 KB
/
upsample_image.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
exe_name=$0
exe_dir=`dirname "$0"`
if [ $# -lt "4" ];then
echo "Usage:
./upsample_image.sh INPUT OUTPUT OUTPUTSIZE INTERP MEMSAFE COMPRESSION OUTPUTTYPE
INPUT Input image, either a 3D tif or a folder.
OUTPUT Output image, either a 3D tif or a folder. For big images, use a
folder, where multiple 2D slices will be written
OUTPUTSIZE Output image size, in pixels. It must be bigger than input image
size. E.g. 1000x1000x2000 (separated by "x")
INTERP Interpolation type, either nearest, bilinear, or cubic
MEMSAFE (Optional) Either true or false, depending if memory efficient
image reading is used. Default false.
COMPRESSION (Optional) Either true or false, if the output image is to
be compressed. Default false, i.e. no compression.
* Applicable only if the output is a 3D tif. For an output
folder, the 2D tif images are always compressed.
OUTPUTTYPE (Optional) Either uint16 or float32. Default is uint16.
"
exit 1
fi
MCRROOT=/usr/local/matlab-compiler/v912
MCR_INHIBIT_CTF_LOCK=1
export MCR_CACHE_ROOT=/tmp/mcr_${USER}_${RANDOM}
mkdir -p ${MCR_CACHE_ROOT}
LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/opengl/lib/glnxa64;
export LD_LIBRARY_PATH;
args=
while [ $# -gt 0 ]; do
token=$1
args="${args} ${token}"
shift
done
echo ${exe_dir}/upsample_image $args
${exe_dir}/upsample_image $args
rm -rf ${MCR_CACHE_ROOT}