This repository has been archived by the owner on Dec 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
64 lines (54 loc) · 1.69 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
# Creates docker container that runs dcm2niix
#
# Example usage:
# docker run --rm -ti \
# -v <someDirWithDicoms>:/flywheel/v0/input/dcm2niix_input \
# -v <emptyOutputFolder>:/flywheel/v0/output \
# scitran/dcm2niix
#
#
# Start with neurodebian image
FROM neurodebian:xenial
MAINTAINER Michael Perry <[email protected]>
# Install packages
RUN apt-get update -qq \
&& apt-get install -y \
git \
curl \
build-essential \
cmake \
pkg-config \
libgdcm-tools \
bsdtar \
unzip \
pigz \
gzip \
wget \
jq \
python-pip \
python-nibabel
COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt && rm -rf /root/.cache/pip
# Compile DCM2NIIX from source
ENV DCMCOMMIT=485c387c93bbca3b29b93403dfde211c4bc39af6
RUN curl -#L https://github.com/rordenlab/dcm2niix/archive/$DCMCOMMIT.zip | bsdtar -xf- -C /usr/local
WORKDIR /usr/local/dcm2niix-${DCMCOMMIT}/build
RUN cmake -DUSE_OPENJPEG=ON -MY_DEBUG_GE=ON ../ && \
make && \
make install
# Make directory for flywheel spec (v0)
ENV FLYWHEEL /flywheel/v0
WORKDIR ${FLYWHEEL}
## Copy in fix_dcm_vols
ENV FIXDCMCOMMIT=918ee3327174c3c736e7b3839a556e0a709730c8
RUN curl -#L https://raw.githubusercontent.com/VisionandCognition/NHP-Process-MRI/$FIXDCMCOMMIT/bin/fix_dcm_vols > ${FLYWHEEL}/fix_dcm_vols.py
RUN chmod +x ${FLYWHEEL}/fix_dcm_vols.py
# Add executables
COPY run run_dcm2niix metadata.py coil_combine.py ./
RUN chmod 777 run metadata.py coil_combine.py fix_dcm_vols.py
# Create Flywheel User
RUN adduser --disabled-password --gecos "Flywheel User" flywheel
# Add manifest
COPY manifest.json ${FLYWHEEL}/manifest.json
# Configure entrypoint
ENTRYPOINT ["/flywheel/v0/run"]