forked from vistalab/docker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun
More file actions
executable file
·60 lines (49 loc) · 1.56 KB
/
run
File metadata and controls
executable file
·60 lines (49 loc) · 1.56 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
#! /bin/bash
#
#
show_help ()
{
# Show example usage
echo -e "[vistalab/recon-all]
Example Usage:
docker run --rm -ti -v </input/dir/>:/input -v </output/dir/>:/output vistalab/recon-all -i /input/<input_file> -subjid <id> -all \n"
# Prompt the user before displaying recon-all help
echo "Would you like to see the DOC for recon-all? (y/N)"
read response
if [[ $response == "y" ]]
then
echo "Showing DOC for recon-all (type 'q' to exit):"
sleep 2
recon-all | less
else
echo "Goodbye."
exit 0
fi
}
# Check if the inputs are empty.
# If so, show example usage and prompt for help
if [[ -z $@ ]]; then
show_help
fi
# Run the algorithm
recon-all $@
# Get a list of the folders in the output directory
outputs=`find $SUBJECTS_DIR -mindepth 1 -maxdepth 2 -type d`
# If outputs exist, then go on...
if [[ -z $outputs ]]
then
echo "Expected outputs were NOT found!"
exit 1
else
echo "All good, leaving..."
# # Set file permissions prior to compression
# chmod -R 777 $SUBJECTS_DIR/*
# # Compress the output to /tmp and name with current date and time
# results_dir=/recon-all_results_$4/
# mkdir $results_dir
# mv $SUBJECTS_DIR/* $results_dir
# zip -r /$SUBJECTS_DIR/recon-all_results_$4`date +"_D%m-%d-%yT%H-%M"`.zip $results_dir
# rm -rf $results_dir
# chmod -R 777 $SUBJECTS_DIR
fi
exit 0