-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
116 lines (94 loc) · 3.66 KB
/
Dockerfile
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
FROM neurodebian:bionic-non-free
ARG DEBIAN_FRONTEND="noninteractive"
## BIDS Validator
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
ca-certificates curl apt-utils build-essential \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN node --version && npm --version && npm install -g [email protected]
## FSL
RUN apt-get update -qq && \
apt-get install -q -y --no-install-recommends fsl-core=5.0.9-5~nd18.04+1 && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Configure environment
ENV FSLDIR=/usr/share/fsl/5.0
ENV FSLOUTPUTTYPE=NIFTI_GZ
ENV PATH=/usr/lib/fsl/5.0:$PATH
ENV FSLMULTIFILEQUIT=TRUE
ENV POSSUMDIR=/usr/share/fsl/5.0
ENV LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH
ENV FSLTCLSH=/usr/bin/tclsh
ENV FSLWISH=/usr/bin/wish
ENV FSLOUTPUTTYPE=NIFTI_GZ
#### FreeSurfer
RUN apt-get update -qq && \
apt-get install -q -y --no-install-recommends \
tcsh \
bc \
tar \
libgomp1 \
perl-modules \
libglu1-mesa wget && \
rm -rf /var/lib/apt/lists/*
RUN apt-get -y update && \
wget -qO- https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.0/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0.tar.gz | tar zxv -C /opt \
--exclude='freesurfer/subjects/fsaverage_sym' \
--exclude='freesurfer/subjects/fsaverage3' \
--exclude='freesurfer/subjects/fsaverage4' \
--exclude='freesurfer/subjects/fsaverage5' \
--exclude='freesurfer/subjects/fsaverage6' \
--exclude='freesurfer/subjects/cvs_avg35' \
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
--exclude='freesurfer/subjects/bert' \
--exclude='freesurfer/subjects/V1_average' \
--exclude='freesurfer/average/mult-comp-cor' \
--exclude='freesurfer/lib/cuda' \
--exclude='freesurfer/lib/qt'
# Set up the environment
ENV OS=Linux
ENV FS_OVERRIDE=0
ENV FIX_VERTEX_AREA=
ENV SUBJECTS_DIR=/opt/freesurfer/subjects
ENV FSF_OUTPUT_FORMAT=nii.gz
ENV MNI_DIR=/opt/freesurfer/mni
ENV LOCAL_DIR=/opt/freesurfer/local
ENV FREESURFER_HOME=/opt/freesurfer
ENV FSFAST_HOME=/opt/freesurfer/fsfast
ENV MINC_BIN_DIR=/opt/freesurfer/mni/bin
ENV MINC_LIB_DIR=/opt/freesurfer/mni/lib
ENV MNI_DATAPATH=/opt/freesurfer/mni/data
ENV FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast
ENV PERL5LIB=/opt/freesurfer/mni/lib/perl5/5.8.5
ENV MNI_PERL5LIB=/opt/freesurfer/mni/lib/perl5/5.8.5
ENV PATH=/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
RUN echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IC9vcHQvZnJlZXN1cmZlci9saWNlbnNlLnR4dAo=" | base64 -d | sh
RUN apt-get update -qq && \
apt-get install -q -y --no-install-recommends \
python3 \
python3-pip && \
rm -rf /var/lib/apt/lists/* && \
pip3 install \
pandas \
pybids \
nibabel \
joblib
## Tracula and Freesurfer run code
RUN mkdir -p /code
COPY run.py /code/run.py
COPY tracula.py /code/tracula.py
RUN chmod +x /code/run.py
# freesurfer repo
RUN wget --progress=dot:giga https://github.com/bids-apps/freesurfer/archive/v6.0.0-5.tar.gz && \
tar xfz v6.0.0-5.tar.gz && \
rm -r v6.0.0-5.tar.gz && \
cd freesurfer-6.0.0-5 && \
mv run.py /code/run_freesurfer.py
RUN touch /code/version
ENV PATH=/code:$PATH
COPY version /version
ENTRYPOINT ["/code/run.py"]