Repository navigation
Expand file tree
/
Copy pathinstall_abba_atlases.sh
More file actions
130 lines (112 loc) · 3.94 KB
/
Copy pathinstall_abba_atlases.sh
File metadata and controls
130 lines (112 loc) · 3.94 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
################################################################################
# Help #
################################################################################
function Help()
{
# Display Help
echo ------ Aligning Big Brains And Altlases Atlases Installer Script -------------
echo "If you have run the install abba script, this script will "
echo "download the mouse allen brain atlas and rat atlas into the"
echo "the appropriate default atlas folder (/abba_atlases)."
echo "If atlases have already been downloaded, nothing will happen."
echo
echo "You can specify the folder where to install these components as an "
echo "argument of this script. For instance: "
echo ""
echo "Windows:"
echo "./install_abba_atlases.sh \"C:/\""
echo ""
echo "If no path is specified, you will be asked for one."
echo
}
while getopts ":h" option; do
case $option in
h) # display Help
Help
exit;;
esac
done
# ----------------- FUNCTIONS -------------------
# Wait for user
function pause(){
read -p "$*"
}
# Returns
function getuserdir(){
local __resultvar=$1
local myresult=
while true ; do
read -r -p "Path: " myresult
if [ -d "$myresult" ] ; then
break
fi
echo "$myresult is not a directory... try without slash at the end (unless it's the root drive like C:/)"
done
eval $__resultvar="'$myresult'"
}
# ----------------- MAIN --------------------------
echo ------ Aligning Big Brains And Altlases Installer Script -------------
# ------- INSTALLATION PATH VALIDATION
echo ------- Installation path validation
if [ $# -eq 0 ]
then
echo "Please enter the installation path for atlases, (without abba_atlases subfolder)"
getuserdir path_install
else
if [ -d "$1" ] ; then
path_install=$1
else
echo $1 is not a valid path
echo "Please enter the installation path for atlases, (without abba_atlases subfolder)"
getuserdir path_install
fi
fi
# ------ SETTING UP IMAGEJ/FIJI
echo "Creating ABBA atlases folder, if it does not exist"
mkdir -p "$path_install/abba_atlases"
echo "--- Downloading Mouse Adult Allen Brain Atlas CCFv3 (https://zenodo.org/record/4486659#.Yc2Rklko_iE)"
echo "- Ontology"
ontology_path="$path_install/abba_atlases/1.json"
if test -f "$ontology_path"; then
echo "$ontology_path already exists - skipping"
else
curl "https://zenodo.org/record/4486659/files/1.json" -L -# -o "$ontology_path"
fi
echo "- Xml"
xml_path="$path_install/abba_atlases/mouse_brain_ccfv3.xml"
if test -f "$xml_path"; then
echo "$xml_path already exists - skipping"
else
curl "https://zenodo.org/record/4486659/files/ccf2017-mod65000-border-centered-mm-bc.xml" -L -# -o "$xml_path"
fi
echo "- Hdf5"
h5_path="$path_install/abba_atlases/ccf2017-mod65000-border-centered-mm-bc.h5"
if test -f "$h5_path"; then
echo "$h5_path already exists - skipping"
else
curl "https://zenodo.org/record/4486659/files/ccf2017-mod65000-border-centered-mm-bc.h5" -L -# -o "$h5_path"
fi
echo "--- Downloading Waxholm Space atlas of the Sprague Dawley Rat Brain V4 (https://zenodo.org/record/5644162#.Yc2Rq1ko_iE)"
echo "- Ontology"
ontology_path="$path_install/abba_atlases/WHS_SD_rat_atlas_v4_labels.ilf"
if test -f "$ontology_path"; then
echo "$ontology_path already exists - skipping"
else
curl "https://zenodo.org/record/5644162/files/WHS_SD_rat_atlas_v4_labels.ilf" -L -# -o "$ontology_path"
fi
echo "- Xml"
xml_path="$path_install/abba_atlases/WHS_SD_rat_atlas_v4.xml"
if test -f "$xml_path"; then
echo "$xml_path already exists - skipping"
else
curl "https://zenodo.org/record/5644162/files/WHS_SD_rat_atlas_v4.xml" -L -# -o "$xml_path"
fi
echo "- Hdf5"
h5_path="$path_install/abba_atlases/WHS_SD_rat_atlas_v4.h5"
if test -f "$h5_path"; then
echo "$h5_path already exists - skipping"
else
curl "https://zenodo.org/record/5644162/files/WHS_SD_rat_atlas_v4.h5" -L -# -o "$h5_path"
fi
echo ------ DONE ------