forked from bids-apps/freesurfer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Singularity_fs7
314 lines (296 loc) · 8.24 KB
/
Singularity_fs7
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty
# Latest release: Neurodocker version 0.7.0
#
# Thank you for using Neurodocker. If you discover any issues
# or ways to improve this software, please submit an issue or
# pull request on our GitHub repository:
#
# https://github.com/ReproNim/neurodocker
#
# Timestamp: 2021/06/06 14:03:48 UTC
Bootstrap: docker
From: ubuntu:xenial
%post
su - root
export ND_ENTRYPOINT="/neurodocker/startup.sh"
apt-get update -qq
apt-get install -y -q --no-install-recommends \
apt-utils \
bzip2 \
ca-certificates \
curl \
locales \
unzip
apt-get clean
rm -rf /var/lib/apt/lists/*
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales
update-locale LANG="en_US.UTF-8"
chmod 777 /opt && chmod a+s /opt
mkdir -p /neurodocker
if [ ! -f "$ND_ENTRYPOINT" ]; then
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT"
echo 'set -e' >> "$ND_ENTRYPOINT"
echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT"
echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT";
fi
chmod -R 777 /neurodocker && chmod a+s /neurodocker
apt-get update -qq
apt-get install -y -q --no-install-recommends \
tcsh \
bc \
tar \
libgomp1 \
perl-modules \
wget \
curl \
libsm-dev \
libx11-dev \
libxt-dev \
libxext-dev \
libglu1-mesa \
libpython2.7-stdlib
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get update -qq
apt-get install -y -q --no-install-recommends \
bc \
libgomp1 \
libxmu6 \
libxt6 \
perl \
tcsh
apt-get clean
rm -rf /var/lib/apt/lists/*
echo "Downloading FreeSurfer ..."
mkdir -p /opt/freesurfer
curl -fsSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.1/freesurfer-linux-centos6_x86_64-7.1.1.tar.gz \
| tar -xz -C /opt/freesurfer --strip-components 1 \
--exclude='freesurfer/average/mult-comp-cor' \
--exclude='freesurfer/lib/cuda' \
--exclude='freesurfer/lib/qt' \
--exclude='freesurfer/subjects/V1_average' \
--exclude='freesurfer/subjects/bert' \
--exclude='freesurfer/subjects/cvs_avg35' \
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
--exclude='freesurfer/subjects/fsaverage3' \
--exclude='freesurfer/subjects/fsaverage4' \
--exclude='freesurfer/subjects/fsaverage5' \
--exclude='freesurfer/subjects/fsaverage6' \
--exclude='freesurfer/subjects/fsaverage_sym' \
--exclude='freesurfer/trctrain'
sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT"
export PATH="/opt/miniconda-latest/bin:$PATH"
echo "Downloading Miniconda installer ..."
conda_installer="/tmp/miniconda.sh"
curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash "$conda_installer" -b -p /opt/miniconda-latest
rm -f "$conda_installer"
conda update -yq -nbase conda
conda config --system --prepend channels conda-forge
conda config --system --set auto_update_conda false
conda config --system --set show_channel_urls true
sync && conda clean -y --all && sync
conda install -y -q --name base \
"python=3" \
"pip" \
"pandas" \
"setuptools" \
"pandas=0.21.0"
sync && conda clean -y --all && sync
bash -c "source activate base
pip install --no-cache-dir \
"nibabel""
rm -rf ~/.cache/pip/*
sync
bash -c 'curl -sL https://deb.nodesource.com/setup_14.x | bash -'
apt-get update -qq
apt-get install -y -q --no-install-recommends \
nodejs
apt-get clean
rm -rf /var/lib/apt/lists/*
bash -c 'npm install -g bids-validator@0.19.8'
mkdir root/matlab && touch root/matlab/startup.m
mkdir /scratch
mkdir /local-scratch
chmod +x /run.py
echo '{
\n "pkg_manager": "apt",
\n "instructions": [
\n [
\n "base",
\n "ubuntu:xenial"
\n ],
\n [
\n "user",
\n "root"
\n ],
\n [
\n "_header",
\n {
\n "version": "generic",
\n "method": "custom"
\n }
\n ],
\n [
\n "install",
\n [
\n "tcsh",
\n "bc",
\n "tar",
\n "libgomp1",
\n "perl-modules",
\n "wget",
\n "curl",
\n "libsm-dev",
\n "libx11-dev",
\n "libxt-dev",
\n "libxext-dev",
\n "libglu1-mesa",
\n "libpython2.7-stdlib"
\n ]
\n ],
\n [
\n "freesurfer",
\n {
\n "version": "7.1.1",
\n "install_path": "/opt/freesurfer"
\n }
\n ],
\n [
\n "miniconda",
\n {
\n "use_env": "base",
\n "conda_install": [
\n "python=3",
\n "pip",
\n "pandas",
\n "setuptools",
\n "pandas=0.21.0"
\n ],
\n "pip_install": [
\n "nibabel"
\n ]
\n }
\n ],
\n [
\n "run_bash",
\n "curl -sL https://deb.nodesource.com/setup_14.x | bash -"
\n ],
\n [
\n "install",
\n [
\n "nodejs"
\n ]
\n ],
\n [
\n "run_bash",
\n "npm install -g bids-validator@0.19.8"
\n ],
\n [
\n "env",
\n {
\n "FSLDIR": "/usr/share/fsl/5.0",
\n "FSLOUTPUTTYPE": "NIFTI_GZ",
\n "FSLMULTIFILEQUIT": "TRUE",
\n "POSSUMDIR": "/usr/share/fsl/5.0",
\n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:",
\n "FSLTCLSH": "/usr/bin/tclsh",
\n "FSLWISH": "/usr/bin/wish"
\n }
\n ],
\n [
\n "env",
\n {
\n "OS": "Linux",
\n "FS_OVERRIDE": "0",
\n "FIX_VERTEX_AREA": "",
\n "SUBJECTS_DIR": "/opt/freesurfer/subjects",
\n "FSF_OUTPUT_FORMAT": "nii.gz",
\n "MNI_DIR": "/opt/freesurfer/mni",
\n "LOCAL_DIR": "/opt/freesurfer/local",
\n "FREESURFER_HOME": "/opt/freesurfer",
\n "FSFAST_HOME": "/opt/freesurfer/fsfast",
\n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin",
\n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib",
\n "MNI_DATAPATH": "/opt/freesurfer/mni/data",
\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast",
\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5",
\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/",
\n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
\n "PYTHONPATH": ""
\n }
\n ],
\n [
\n "run",
\n "mkdir root/matlab && touch root/matlab/startup.m"
\n ],
\n [
\n "run",
\n "mkdir /scratch"
\n ],
\n [
\n "run",
\n "mkdir /local-scratch"
\n ],
\n [
\n "copy",
\n [
\n "run.py",
\n "/run.py"
\n ]
\n ],
\n [
\n "run",
\n "chmod +x /run.py"
\n ],
\n [
\n "copy",
\n [
\n "version",
\n "/version"
\n ]
\n ],
\n [
\n "entrypoint",
\n "/neurodocker/startup.sh /run.py \"$@\""
\n ]
\n ]
\n}' > /neurodocker/neurodocker_specs.json
%environment
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export ND_ENTRYPOINT="/neurodocker/startup.sh"
export FREESURFER_HOME="/opt/freesurfer"
export PATH="/opt/freesurfer/bin:$PATH"
export CONDA_DIR="/opt/miniconda-latest"
export PATH="/opt/miniconda-latest/bin:$PATH"
export FSLDIR="/usr/share/fsl/5.0"
export FSLOUTPUTTYPE="NIFTI_GZ"
export FSLMULTIFILEQUIT="TRUE"
export POSSUMDIR="/usr/share/fsl/5.0"
export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:"
export FSLTCLSH="/usr/bin/tclsh"
export FSLWISH="/usr/bin/wish"
export OS="Linux"
export FS_OVERRIDE="0"
export FIX_VERTEX_AREA=""
export SUBJECTS_DIR="/opt/freesurfer/subjects"
export FSF_OUTPUT_FORMAT="nii.gz"
export MNI_DIR="/opt/freesurfer/mni"
export LOCAL_DIR="/opt/freesurfer/local"
export FREESURFER_HOME="/opt/freesurfer"
export FSFAST_HOME="/opt/freesurfer/fsfast"
export MINC_BIN_DIR="/opt/freesurfer/mni/bin"
export MINC_LIB_DIR="/opt/freesurfer/mni/lib"
export MNI_DATAPATH="/opt/freesurfer/mni/data"
export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast"
export PERL5LIB="/opt/freesurfer/mni/share/perl5"
export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/"
export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export PYTHONPATH=""
%files
run.py /run.py
version /version
%runscript
/neurodocker/startup.sh /run.py "$@"