|
a |
|
b/scripts/runtime-script |
|
|
1 |
#!/bin/bash |
|
|
2 |
|
|
|
3 |
echo "This file is currently deprecated - if needed, please make an issue on the corresponding Github repository" |
|
|
4 |
exit 125 |
|
|
5 |
|
|
|
6 |
WEIGHTS_DIRECTORY="/Users/arjundesai/Documents/stanford/research/msk_pipeline_raw/weights" |
|
|
7 |
if [ -z "$WEIGHTS_DIRECTORY" ]; then |
|
|
8 |
echo "Please define WEIGHTS_DIRECTORY in script. Use the absolute path" |
|
|
9 |
exit 125 |
|
|
10 |
fi |
|
|
11 |
|
|
|
12 |
if [ $# -eq 1 ] |
|
|
13 |
then |
|
|
14 |
SERIES="qdess" |
|
|
15 |
else |
|
|
16 |
SERIES=$2 |
|
|
17 |
fi |
|
|
18 |
|
|
|
19 |
# find relevant dicom files |
|
|
20 |
|
|
|
21 |
FILES=$(find $1 -type d -name $SERIES) |
|
|
22 |
|
|
|
23 |
cd .. |
|
|
24 |
|
|
|
25 |
for i in $FILES; do |
|
|
26 |
DIRNAME=$(dirname $i) |
|
|
27 |
SAVE_DIRNAME="$DIRNAME/data" |
|
|
28 |
CUBEQUANT_DIRNAME="$DIRNAME/cubequant" |
|
|
29 |
CONES_DIRNAME="$DIRNAME/cones" |
|
|
30 |
TARGET_SCAN="$SAVE_DIRNAME/qdess_data/echo1.nii.gz" |
|
|
31 |
MASK="$SAVE_DIRNAME/fc/fc.nii.gz" |
|
|
32 |
|
|
|
33 |
CUBEQUANT_INTERREGISTERED_DATA="$SAVE_DIRNAME/cubequant_data/interregistered" |
|
|
34 |
CUEQUANT_T1RHO="$SAVE_DIRNAME/cubequant_data/t1_rho.nii.gz" |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
CONES_INTERREGISTERED_DATA="$SAVE_DIRNAME/cones_data/interregistered" |
|
|
38 |
CONES_T2STAR="$SAVE_DIRNAME/cones_data/t2_star.nii.gz" |
|
|
39 |
|
|
|
40 |
echo "" |
|
|
41 |
echo "----------Analyzing $DIRNAME---------" |
|
|
42 |
|
|
|
43 |
# use qDESS to get femoral cartilage segmentation + 3D t2 maps |
|
|
44 |
echo "qDESS T2map time:" |
|
|
45 |
python -m pipeline -d $i -s $SAVE_DIRNAME qdess -fc -t2 |
|
|
46 |
|
|
|
47 |
echo "segmentation time:" |
|
|
48 |
python -m pipeline -l $SAVE_DIRNAME -s $SAVE_DIRNAME qdess -fc segment -rms --weights_dir $WEIGHTS_DIRECTORY |
|
|
49 |
|
|
|
50 |
echo "cubequant registration time:" |
|
|
51 |
echo $CUBEQUANT_INTERREGISTERED_DATA |
|
|
52 |
python -m pipeline -d $CUBEQUANT_DIRNAME -s $SAVE_DIRNAME cq interregister -ts $TARGET_SCAN |
|
|
53 |
|
|
|
54 |
echo "cubequant T2map time:" |
|
|
55 |
python -m pipeline -l $SAVE_DIRNAME cq -t1rho -fm $MASK |
|
|
56 |
|
|
|
57 |
echo "cones registration time:" |
|
|
58 |
python -m pipeline -d $CONES_DIRNAME -s $SAVE_DIRNAME cones interregister -ts $TARGET_SCAN |
|
|
59 |
|
|
|
60 |
echo "cones t2star time:" |
|
|
61 |
python -m pipeline -l $SAVE_DIRNAME cones -t2star -fm $MASK |
|
|
62 |
|
|
|
63 |
echo "analysis time" |
|
|
64 |
python -m pipeline -l $SAVE_DIRNAME knee -fc -t2 -t1_rho -t2_star |
|
|
65 |
done |