-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_test.sh
executable file
·48 lines (40 loc) · 1.17 KB
/
run_test.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
subjID=`jq -r '._inputs[0].meta.subject' config.json`
static=`jq -r '.tractogram_static' config.json`
t1_static=`jq -r '.t1_static' config.json`
echo "Check the inputs subject id"
if [ ! $subjID == `jq -r '._inputs[1].meta.subject' config.json` ]; then
echo "Inputs subject id incorrectly inserted. Check them again."
exit 1
fi
echo "Tractogram conversion to trk"
if [[ $static == *.tck ]];then
echo "Input in tck format. Convert it to trk."
cp $static ./tractogram_static.tck
python tck2trk.py $t1_static tractogram_static.tck -f
cp tractogram_static.trk $subjID'_track.trk'
else
echo "Tractogram already in .trk format"
cp $static $subjID'_track.trk'
fi
echo "Running Classifyber (only test)"
mkdir -p tracts_trks
python test_classifyber.py \
-src_dir 'results_training' \
-static $subjID'_track.trk' \
-out_dir 'tracts_trks'
if [ -z "$(ls -A -- "tracts_trks")" ]; then
echo "Segmentation failed."
exit 1
else
echo "Segmentation done."
fi
echo "Building the wmc structure"
mkdir -p tracts
python build_wmc.py -tractogram $static
if [ -f 'classification.mat' ]; then
echo "WMC structure created."
else
echo "WMC structure missing."
exit 1
fi