This repository was archived by the owner on Aug 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdemo_avionic_perf.sh
More file actions
executable file
·97 lines (84 loc) · 3.25 KB
/
demo_avionic_perf.sh
File metadata and controls
executable file
·97 lines (84 loc) · 3.25 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# AVIONIC DEMO perfusion MRI DATA
# setting paths
FUNCTYPE="ICTGV2"
PATTERN="vista"
R=16
function usage()
{
echo "AVIONIC Demo for cardiac perfusion MRI data"
echo ""
echo "-h Display help"
echo "--functype=$FUNCTYPE: Regularization functional: ICTGV2, TGV2, TV"
echo "--pattern=$PATTERN: Sampling pattern: vista, vd (variable density), uni"
echo "--red=$R options: Undersampling factor: 4 8 12 16"
echo ""
}
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
case $PARAM in
-h | --help)
usage
exit
;;
--functype)
FUNCTYPE=$VALUE
;;
--pattern)
PATTERN=$VALUE
;;
--red)
R=$VALUE
;;
*)
echo "ERROR: unknown parameter \"$PARAM\""
usage
exit 1
;;
esac
shift
done
###########################################
echo "==================================================================================="
echo "Running $FUNCTYPE Reconstruction on cardiac perfusion data with $PATTERN pattern and R=$R"
echo "==================================================================================="
DATAFILE="cardiac_perfusion_data.bin"
PATTERNFILE="cardiac_perfusion_${PATTERN}_acc${R}.bin"
RESULTSFILE="${FUNCTYPE}_recon_cardiac_perfusion_${PATTERN}_acc${R}"
echo "==================================================================================="
echo "Downloading Data"
echo "==================================================================================="
if [ ! -f $DATAFILE ]
then
wget https://zenodo.org/record/807196/files/cardiac_perfusion_data.bin
fi
if [ ! -f $PATTERNFILE ]
then
wget https://zenodo.org/record/807196/files/$PATTERNFILE
fi
echo "==================================================================================="
echo "Run Reconstruction"
echo "==================================================================================="
mkdir ./results_perfusion/
nENC=128;nRO=128;nFRAMES=40;nCOILS=12;
nX=$nRO;nY=$nENC;
if [ ! -f ./results_perfusion/${RESULTSFILE}.bin ]
then
recon_cmd="./CUDA/bin/avionic -o -i 500 -m $FUNCTYPE -e -a \
-p ./CUDA/config/default_perf.cfg -d $nX:$nY:0:$nRO:$nENC:0:$nCOILS:$nFRAMES \
$DATAFILE $PATTERNFILE \
./results_perfusion/${RESULTSFILE}.bin"
echo "------------------------------------------------------------------------"
echo "$recon_cmd"
echo "------------------------------------------------------------------------"
eval $recon_cmd
mv ./results_perfusion/x3_component ./results_perfusion/${RESULTSFILE}_comp.bin
mv ./results_perfusion/PDGap ./results_perfusion/${RESULTSFILE}_pdgap.bin
mv ./results_perfusion/b1_reconstructed.bin ./results_perfusion/${RESULTSFILE}_b1.bin
mv ./results_perfusion/u0_reconstructed.bin ./results_perfusion/${RESULTSFILE}_initguess.bin
fi
echo "==================================================================================="
echo "Display Results"
echo "==================================================================================="
./python/show_avionic.py -f "./results_perfusion/${RESULTSFILE}.bin" -nx $nRO -ny $nENC -nframes $nFRAMES