-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
113 lines (95 loc) · 3.51 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
FROM debian:bullseye
LABEL maintainer="<[email protected]>"
# dcm2niix version
ENV DCM2NIIXTAG v1.0.20230411
#heudiconv version:
ENV HEUDICONVTAG unstacked_dcm
#bids validator version:
ENV BIDSTAG 1.9.7
#pydeface version:
ENV PYDEFACETAG v2.0.2
ARG DEBIAN_FRONTEND="noninteractive"
# install dcm2niix
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
apt-utils \
ca-certificates \
locales \
pigz \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& mkdir /opt/dcm2niix \
&& wget -q -O /opt/dcm2niix/dcm2niix.zip https://github.com/rordenlab/dcm2niix/releases/download/${DCM2NIIXTAG}/dcm2niix_lnx.zip \
&& unzip /opt/dcm2niix/dcm2niix.zip -d /opt/dcm2niix \
&& rm /opt/dcm2niix/dcm2niix.zip
ENV PATH /opt/dcm2niix:$PATH
# install heudiconv
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
python3=3.9.2-3 \
python3-pip=20.3.4-4+deb11u1 \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
git \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& git clone https://github.com/AlanKuurstra/heudiconv.git /src/heudiconv \
&& git -C /src/heudiconv checkout ${HEUDICONVTAG}
WORKDIR /src/heudiconv
RUN python3 -m pip install --no-cache-dir -r /src/heudiconv/requirements.txt \
&& python3 -m pip install --no-cache-dir versioningit \
&& python3 /src/heudiconv/setup.py install
# install pybruker for cfmm_bruker heuristic
RUN python3 -m pip install --no-cache-dir pybruker --index-url https://gitlab.com/api/v4/projects/29466867/packages/pypi/simple
# install BIDS Validator
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN npm install -g bids-validator@${BIDSTAG}
# install GNU parallel
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
parallel \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& echo "LANG=en_US.UTF-8" > /etc/locale.conf \
&& echo "LC_ALL=en_US.UTF-8" >> /etc/locale.conf \
&& locale-gen en_US.UTF-8
# install FSL flirt and fslorient
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
libxml2-dev \
libopenblas-dev \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip install --no-cache-dir pytest===3.6.0 networkx==2.0
ENV FSLDIR /opt/fsl
ENV FSLOUTPUTTYPE NIFTI_GZ
RUN mkdir -p $FSLDIR/bin \
&& wget -q -O $FSLDIR/bin/flirt https://www.dropbox.com/s/3wf2i7eiosoi8or/flirt \
&& wget -q -O $FSLDIR/bin/fslorient https://www.dropbox.com/s/t4grjp9aixwm8q9/fslorient \
&& chmod a+x $FSLDIR/bin/*
ENV PATH $FSLDIR/bin:$PATH
# install pydeface
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
git \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& git clone https://github.com/poldracklab/pydeface /src/pydeface \
&& git -C /src/pydeface checkout ${PYDEFACETAG}
WORKDIR /src/pydeface
RUN python3 /src/pydeface/setup.py install
WORKDIR /
# install tar2bids
RUN mkdir -p /opt/tar2bids
COPY . /opt/tar2bids
# set up env vars
ENV LANGUAGE "en_US.UTF-8"
ENV LC_ALL "en_US.UTF-8"
ENV LANG "en_US.UTF-8"
ENV PYTHONPATH $PYTHONPATH:/opt/tar2bids/heuristics
ENTRYPOINT ["/opt/tar2bids/tar2bids"]