Repository navigation
Expand file tree
/
Copy pathinstall_fiji_update_sites.sh
More file actions
178 lines (146 loc) · 5.36 KB
/
Copy pathinstall_fiji_update_sites.sh
File metadata and controls
178 lines (146 loc) · 5.36 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#!/bin/bash
################################################################################
# Help #
################################################################################
function Help()
{
# Display Help
echo ------ Fiji Update Sites Installer Script -------------
echo "This adds update sites to an existing Fiji install"
echo "The following sites are automatically installed:"
echo " - 3D Image Suite"
echo " - ABBA"
echo " - BigStitcher"
echo " - Bio-Formats"
echo " - CSBDeep"
echo " - Fiji-EasyXT"
echo " - IBMP-CNRS"
echo " - IJPB-Plugins"
echo " - ImageScience"
echo " - Operetta Importer"
echo " - PTBIOP (obviously)"
echo " - Stardist"
echo " - TensorFlow"
echo
echo "You need to specify the folder where Fiji is installed as an "
echo "argument of this script. For instance: "
echo ""
echo "Windows:"
echo "./install_fiji_update_sites.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'"
}
echo ------ ImageJ/Fiji Installer Script -------------
echo "This batch file installs a selection of Fiji update sites"
echo "Make sure Fiji is closed while running this script!"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Your OS: Linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Your OS: Mac OSX"
elif [[ "$OSTYPE" == "msys" ]]; then
echo "Your OS: Windows"
else
echo "Unknown OS, the script will exit: $OSTYPE"
pause "Press [Enter] to end the script"
exit 1 # We cannot proceed
fi
# ------- INSTALLATION PATH VALIDATION
echo ------- Installation path validation
if [ $# -eq 0 ]
then
echo "Please enter the installation path of Fiji"
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 of Fiji"
getuserdir path_install
fi
fi
echo "All components will be installed in:"
echo "$path_install"
# ------ SETTING UP IMAGEJ/FIJI
echo ------ Setting up ImageJ/Fiji ------
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Linux unsupported - please contribute to this installer to support it!"
pause "Press [Enter] to end the script"
exit 1 # We cannot proceed
elif [[ "$OSTYPE" == "darwin"* ]]; then
fiji_executable_file="Contents/MacOS/ImageJ-macosx"
fiji_url="https://downloads.imagej.net/fiji/latest/fiji-macosx.zip"
elif [[ "$OSTYPE" == "msys" ]]; then
fiji_executable_file="ImageJ-win64.exe"
fiji_url="https://downloads.imagej.net/fiji/latest/fiji-win64.zip"
fi
fiji_path="$path_install/Fiji.app/$fiji_executable_file"
echo "Looking for Fiji executable: $fiji_path"
if [[ -f "$fiji_path" ]]; then
echo "Fiji is present"
else
echo "Fiji not present, exiting script"
exit 1 # We cannot proceed
fi
# Updating several times because there may be some issues with removing some files after a single update is performed
echo "Updating Fiji"
"$fiji_path" --update update
echo "Fiji updated"
echo "3D ImageJ Suite"
"$fiji_path" --update add-update-site "3D ImageJ Suite" "https://sites.imagej.net/Tboudier/"
echo "Enabling ABBA update site"
"$fiji_path" --update add-update-site "ABBA" "https://biop.epfl.ch/Fiji-ABBA-Exp/"
echo "Enabling BigStitcher update site"
"$fiji_path" --update add-update-site "BigStitcher" "https://sites.imagej.net/BigStitcher/"
echo "Enabling Bio-Formats update site"
"$fiji_path" --update add-update-site "Bio-Formats" "https://sites.imagej.net/Bio-Formats/"
echo "Enabling CSBDeep update site"
"$fiji_path" --update add-update-site "CSBDeep" "https://sites.imagej.net/CSBDeep/"
echo "Enabling Fiji-EasyXT update site"
"$fiji_path" --update add-update-site "Fiji-EasyXT" "https://biop.epfl.ch/Fiji-EasyXT/"
echo "Enabling IBMP-CNRS update site"
"$fiji_path" --update add-update-site "IBMP-CNRS" "https://sites.imagej.net/Mutterer/"
echo "Enabling IJPB-plugins update site"
"$fiji_path" --update add-update-site "IJPB-plugins" "https://sites.imagej.net/IJPB-plugins/"
echo "Enabling ImageScience update site"
"$fiji_path" --update add-update-site "ImageScience" "https://sites.imagej.net/ImageScience/"
echo "Enabling Operetta Importer update site"
"$fiji_path" --update add-update-site "Operetta Importer" "https://biop.epfl.ch/update-sites/operetta/"
echo "Enabling PTBIOP update site"
"$fiji_path" --update add-update-site "PTBIOP" "https://biop.epfl.ch/Fiji-Update"
echo "Enabling StarDist update site"
"$fiji_path" --update add-update-site "StarDist" "https://sites.imagej.net/StarDist/"
echo "Enabling TensorFlow update site"
"$fiji_path" --update add-update-site "TensorFlow" "https://sites.imagej.net/TensorFlow/"
echo "Updating Fiji again"
"$fiji_path" --update update
echo "Fiji should now be up-to-date"
echo "Updating Fiji one last time"
"$fiji_path" --update update
echo "Fiji should now be up-to-date"