-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunsimulationserver.sh
executable file
·66 lines (45 loc) · 1.4 KB
/
runsimulationserver.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
58
59
60
61
62
63
64
65
66
#!/bin/bash
## Preparation
EXPER=WMTMS.01
subjectID=$1
target=$2
simDir=/Volumes/Cabeza/WMTMS.01/Analysis/Efield_Sims/
subjDir=/Volumes/Cabeza/WMTMS.01/Analysis/Efield_Sims/${subjectID}
subsimDir=/Volumes/Cabeza/WMTMS.01/Analysis/Efield_Sims/${subjectID}/simulations
subsimOut=/Volumes/Cabeza/WMTMS.01/Analysis/Efield_Sims/${subjectID}/E-field
meshlabLoc=/Applications/meshlab.app/Contents/MacOS/meshlabserver
## Checking if directories exist, making them if not
if [ ! -d $subjDir ]; then
echo Making Subject Directory.......
mkdir $subjDir
echo Complete
fi
if [ ! -d $subsimDir ]; then
echo Making Subjects Simulation Directory.......
mkdir $subsimDir
echo Complete
fi
if [ ! -d $subsimOut ]; then
echo Making Subjects Output Directory.......
mkdir $subsimOut
echo Complete
fi
echo Preparing Simulation
echo Subject is ${subjectID}
echo Target is ${target}
## Creating Target Grid
echo Creating target Grid
echo Defining skin curvature
meshlabLoc -i ${subsimDir}/m2m_${subjectID}/skin.stl -o
## Simulation Extraction
for i in $(ls *merge.msh)
do
declare b=${i:14:5}
echo $b
#msh2nii --mesh=$i --mask=mask.nii --hdr=../${subjectID}_T1fs_conform.nii.gz --fields=eE --fn_out=$b > /dev/null 2>&1
msh2nii --mesh=$i --mask=mask.nii --hdr=../${subjectID}_T1fs_conform.nii.gz --fields=eE --fn_out=$b > /dev/null 2>&1
done
mv *normE.nii.gz ../ROIanalysis
rm *E.nii.gz
rm *v.nii.gz
rm *J.nii.gz