-
Notifications
You must be signed in to change notification settings - Fork 0
/
runAppXfms.sh
executable file
·57 lines (42 loc) · 987 Bytes
/
runAppXfms.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
49
50
51
52
53
54
55
56
57
#!/bin/bash
if [ "$#" -lt 1 ]
then
echo "Usage: $0 < -f FEATURE > <subjids>"
exit 0
fi
while getopts "f:" options; do
case $options in
f ) echo " Using feature: $OPTARG"
Feature=$OPTARG;;
* ) usage
exit 1;;
esac
done
shift 1
func_name=appXfms
res=100um_5umPad
# Define required directories
data_dir=~/EpilepsyQuantHistology/proc
searchpath=./code
#Load Matlab
module load matlab
for subj in $@
do
subj_dir=$data_dir/${subj}
list=$(ls -d $subj_dir/${res}_Profiles/count/EPI*)
# run through each subject
for slide in $list
do
echo INPUT: $slide
outDir=$subj_dir/${res}_Profiles/$Feature
echo OUTPUT DIRECTORY: $outDir
# check if directory does not exist!
if [ ! -e $outDir ]
then
mkdir $outDir
fi
# Run Matlab
echo "addpath(genpath('$searchpath')); $func_name('$slide','$Feature'); exit" | matlab -nosplash -nodesktop
echo ......................................... DONE ..............................................
done
done