generated from AICONSlab/HippMapp3r
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
executable file
·82 lines (71 loc) · 7.5 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
# Use a Linux Distro as a parent image
FROM ubuntu:16.04
# Set up
RUN apt-get update && apt-get install -y git wget build-essential g++ gcc cmake curl clang && \
apt-get install -y libfreetype6-dev apt-utils pkg-config vim gfortran && \
apt-get install -y binutils make linux-source unzip && \
apt install -y libsm6 libxext6 libfontconfig1 libxrender1 libgl1-mesa-glx && \
apt-get install -y python3-pip python3-dev && \
cd /usr/local/bin/ && \
ln -s /usr/bin/python3 python && \
pip3 install --upgrade pip==20.3.4 && \
cd ~
# Install c3d
RUN wget https://downloads.sourceforge.net/project/c3d/c3d/Nightly/c3d-nightly-Linux-x86_64.tar.gz && \
tar -xzvf c3d-nightly-Linux-x86_64.tar.gz && mv c3d-1.1.0-Linux-x86_64 /opt/c3d && \
rm c3d-nightly-Linux-x86_64.tar.gz
ENV PATH /opt/c3d/bin:${PATH}
# FSL
# Installing Neurodebian packages FSL
# RUN wget -O- http://neuro.debian.net/lists/xenial.us-tn.full | tee /etc/apt/sources.list.d/neurodebian.sources.list
# RUN apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
# Install FSL
RUN apt-get update && apt-get install -y fsl
ENV FSLDIR="/usr/share/fsl/5.0" \
FSLOUTPUTTYPE="NIFTI_GZ" \
FSLMULTIFILEQUIT="TRUE" \
POSSUMDIR="/usr/share/fsl/5.0" \
LD_LIBRARY_PATH="/usr/lib/fsl/5.0:$LD_LIBRARY_PATH" \
FSLTCLSH="/usr/bin/tclsh" \
FSLWISH="/usr/bin/wish" \
POSSUMDIR="/usr/share/fsl/5.0"
ENV PATH="/usr/lib/fsl/5.0:${PATH}"
# Install ANTs
ENV ANTSPATH="/opt/ANTs"
ENV ANTSTAR="/opt/ants.tar.gz"
RUN mkdir -p "${ANTSPATH}" && \
wget -q --show-progress -O "${ANTSTAR}" https://huggingface.co/datasets/AICONSlab/icvmapper/resolve/dev/software/ANTs/ANTs-Linux-centos5_x86_64-v2.2.0-0740f91.tar.gz && \
tar -xzvf "${ANTSTAR}" -C "${ANTSPATH}" --strip-components 1
ENV PATH=${ANTSPATH}:${PATH}
# Install all needed packages based on pip installation
COPY requirements.txt ./
RUN python3 -m pip install --no-cache-dir -r requirements.txt
COPY . .
# Download models, store in directory
RUN mkdir -p /src/icvmapp3r/models /src/hypermapp3r/models && \
# wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1r_TyA65nJoH7Dt2S6oZEluakAgWbPn3_' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1r_TyA65nJoH7Dt2S6oZEluakAgWbPn3_" -O /src/hypermapp3r/models/wmh_mcdp_multi_model_weights.h5 && \
# rm -rf /tmp/cookies.txt && \
# wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1fU566Xtr6KuQ4oT3XWG3s84f6IG2yYfO' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1fU566Xtr6KuQ4oT3XWG3s84f6IG2yYfO" -O /src/hypermapp3r/models/wmh_mcdp_multi_model.json && \
# rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1TDHy6dyuD3CmUPcYJZSHmtOfNEFNhPO4' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1TDHy6dyuD3CmUPcYJZSHmtOfNEFNhPO4" -O /src/hypermapp3r/models/wmh_mcdp_224iso_multi_model_weights.h5 && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1u60w2CzcvMk9JeEFvoCSixoKwLHEaPyQ' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1u60w2CzcvMk9JeEFvoCSixoKwLHEaPyQ" -O /src/hypermapp3r/models/wmh_mcdp_224iso_multi_model.json && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=169CwChQ0uWRgRpKIl-2o4PxCU3pAtIhK' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=169CwChQ0uWRgRpKIl-2o4PxCU3pAtIhK" -O /src/hypermapp3r/models/wmh_mcdp_contrast_model_weights.h5 && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=166EheyNav_oet_Ala3M79MDTOhsboZPx' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=166EheyNav_oet_Ala3M79MDTOhsboZPx" -O /src/hypermapp3r/models/wmh_mcdp_contrast_model.json && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=16CIIr9jzvD-53bhXNHsYBnVhnV0kd9EI' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=16CIIr9jzvD-53bhXNHsYBnVhnV0kd9EI" -O /src/hypermapp3r/models/wmh_mcdp_224iso_all_model_weights.h5 && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1u60w2CzcvMk9JeEFvoCSixoKwLHEaPyQ' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1u60w2CzcvMk9JeEFvoCSixoKwLHEaPyQ" -O /src/hypermapp3r/models/wmh_mcdp_224iso_all_model.json && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=16CIIr9jzvD-53bhXNHsYBnVhnV0kd9EI' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=16CIIr9jzvD-53bhXNHsYBnVhnV0kd9EI" -O /src/hypermapp3r/models/wmh_mcdp_t1only_multi_model_weights.h5 && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=16GcD7xRLk6RrqLaNwnnmjtjJ3GBL47Ye' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=16GcD7xRLk6RrqLaNwnnmjtjJ3GBL47Ye" -O /src/hypermapp3r/models/wmh_mcdp_t1only_multi_model.json && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=16B_bXErCHTGnOUQTCl-p8HkwwuD725SI' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=16B_bXErCHTGnOUQTCl-p8HkwwuD725SI" -O /src/hypermapp3r/models/wmh_mcdp_multi_model_weights.h5 && \
rm -rf /tmp/cookies.txt && \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1667lDAAIVZQWhi3NbfTaBBr3kh1lMSIA' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1667lDAAIVZQWhi3NbfTaBBr3kh1lMSIA" -O /src/hypermapp3r/models/wmh_mcdp_multi_model.json && \
rm -rf /tmp/cookies.txt
# Run hypermapper when the container launches
# ENTRYPOINT ["/bin/bash"]