-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest_simulator_for_artifact_generation.sh
executable file
·56 lines (51 loc) · 1.87 KB
/
test_simulator_for_artifact_generation.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
#!/usr/bin/env bash
ROOT_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
export PYTHONPATH="$PYTHONPATH:$ROOT_DIR"
TO_TEST="scatter"
IN_DIR="$ROOT_DIR/results/example_for artifact_simulation/simulation_001/"
OUT_DIR="$ROOT_DIR/results/test_scatter_artifacts/"
SCANNER="default"
ZSLICE=59
while getopts t:i:o:s:z:h flag
do
case "${flag}" in
t) TO_TEST=${OPTARG};;
i) IN_DIR=${OPTARG};;
o) OUT_DIR=${OPTARG};;
s) SCANNER=${OPTARG};;
z) ZSLICE=${OPTARG};;
h)
echo "Run DEBISim simulation for a CT Phantom (ACR | Battelle A/B) "
echo
echo "Syntax: ./simulate_ct_phantom.sh [-t|i|o|s|z] "
echo "options:"
echo "t artifacts to test (ring | motion | scatter | bag) - bag tests baggage creation artifacts"
echo "i input simulation directory"
echo "o output directory"
echo "s scanner (sensation_32 | definition_as | force | default)"
echo "z ct z slice to process"
echo
exit
;;
esac
done
echo "$ROOT_DIR"
echo "$PYTHONPATH"
echo "Running CT simulation to test simulation of ($TO_TEST) artifacts for scanner ($SCANNER) at: $OUT_DIR from $IN_DIR"
case $TO_TEST in
ring)
python scripts/test_ring_artifact_generation.py --out_dir=$OUT_DIR --scanner=$SCANNER --in_dir=$IN_DIR --zslice=$ZSLICE
;;
motion)
python scripts/test_motion_artifact_generation.py --out_dir=$OUT_DIR --scanner=$SCANNER
;;
scatter)
python scripts/test_scatter_artifact_generation.py --out_dir=$OUT_DIR --scanner=$SCANNER --in_dir=$IN_DIR --zslice=$ZSLICE
;;
bag)
python scripts/test_baggage_creator_performance.py --out_dir=$OUT_DIR --scanner=$SCANNER
;;
*)
echo "Test not recognized - choose from {acr | battelle_a | battelle_b}"
;;
esac