-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_stabilitycalc
More file actions
executable file
·49 lines (46 loc) · 1.55 KB
/
test_stabilitycalc
File metadata and controls
executable file
·49 lines (46 loc) · 1.55 KB
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
#!/bin/bash
# test to make sure nothing has changed.
# numbers come out different on unix and mac so we
# have separate baseline dirs
DATA=${1:-/Users/dmd/mcldata}
#COILS="TxRx 32Ch"
COILS="32Ch"
if ! which gm > /dev/null; then
echo Graphicsmagick not found, aborting.
exit 1
fi
if [ -z "$DATA" ]; then
# out of an abundance of caution because of next line
exit 1
fi
for COIL in $COILS; do
rm -rf $DATA/test$COIL/procresults
done
./stabilitycalc.py $DATA/test32Ch epi_pace.nii.gz 0
failed=0
for COIL in $COILS; do
echo ==================
echo diff $COIL
echo ==================
diff <(sort $DATA/test$COIL/procresults/dataquality.txt) <(sort $DATA/test$COIL.orig/procresults/dataquality.txt)
if [ $? -ne 0 ]; then failed=1; fi
diff <(sort $DATA/test$COIL/procresults/analysissummary.txt) <(sort $DATA/test$COIL.orig/procresults/analysissummary.txt)
if [ $? -ne 0 ]; then failed=1; fi
diff <(grep -v "generated on" $DATA/test$COIL/procresults/output.html) <(grep -v "generated on" $DATA/test$COIL.orig/procresults/output.html)
if [ $? -ne 0 ]; then failed=1; fi
IMAGEDIFFFILE=$(mktemp -t imagediffXXXX)
for IMAGE in $DATA/test$COIL/procresults/*png; do
gm compare -metric mse $IMAGE $DATA/test$COIL.orig/procresults/$(basename $IMAGE) | grep Total | grep -v "Total: 0.0000000000 0.0" >> $IMAGEDIFFFILE
done
if [ -s $IMAGEDIFFFILE ]; then
echo images differ $IMAGEDIFFFILE
failed=1
fi
rm -f $IMAGEDIFFFILE
done
if [ $failed -ne 0 ]; then
echo FAILED
exit 1
else
echo PASSED
fi