-
Notifications
You must be signed in to change notification settings - Fork 1
/
N4Process.sh
executable file
·47 lines (39 loc) · 1.45 KB
/
N4Process.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
#!/bin/bash
exe_name=$0
exe_name=`readlink -f ${exe_name}`
exe_dir=`dirname "$exe_name"`
if [ $# -lt "3" ]; then
echo "Usage:
./N4Process.sh INPUT N4field OUTPUTDIR
INPUT Directory containing original tiff images (e.g., 640 channel
images), or a 3D tiff/nifti image
N4FIELD N4 bias field image, must have same number of slices as the INPUT,
could be downsampled only in x-y direction. The downsampling
factor should be an integer so that,
dim(INPUT) = dsfactor x dim(N4FIELD)
OUTPUTDIR Output directory where corrected images are written
DSFACTOR (Optional) A downsampling factor to downsample the field image
to compute its mode. Default 5x5x5. It can be same as the
downsampling factor used originally. It must be string separated
by x, e.g. 6x6x5
"
exit 1
fi
export MCR_INHIBIT_CTF_LOCK=1
export MCR_CACHE_ROOT=/tmp/mcr_${USER}_${RANDOM}
mkdir -p ${MCR_CACHE_ROOT}
MCRROOT=/usr/local/matlab-compiler/v912
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}/N4Process $args
${exe_dir}/N4Process $args
rm -rf ${MCR_CACHE_ROOT}