-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from mgxd/enh/msm2
FIX+ENH: Gradient coeff + MSMSulc full support
- Loading branch information
Showing
3 changed files
with
132 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,41 @@ | ||
# Use Ubuntu 14.04 LTS | ||
FROM ubuntu:trusty-20170119 | ||
# Use Jessie for correct perl version | ||
# https://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/2016-May/045407.html | ||
FROM neurodebian:jessie-non-free | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ENV LANG="C.UTF-8" \ | ||
LC_ALL="C.UTF-8" | ||
|
||
# Download FreeSurfer | ||
RUN apt-get -y update \ | ||
&& apt-get install -y wget && \ | ||
wget -qO- ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/5.3.0-HCP/freesurfer-Linux-centos4_x86_64-stable-pub-v5.3.0-HCP.tar.gz | tar zxv -C /opt \ | ||
--exclude='freesurfer/trctrain' \ | ||
--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' && \ | ||
apt-get install -y tcsh bc tar libgomp1 perl-modules curl | ||
RUN apt-get -qq update && \ | ||
apt-get install -yq --no-install-recommends \ | ||
bc \ | ||
bzip2 \ | ||
ca-certificates \ | ||
curl \ | ||
libgomp1 \ | ||
perl-modules \ | ||
tar \ | ||
tcsh \ | ||
wget && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | ||
wget -qO- ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/5.3.0-HCP/freesurfer-Linux-centos4_x86_64-stable-pub-v5.3.0-HCP.tar.gz \ | ||
| tar zxv -C /opt \ | ||
--exclude='freesurfer/trctrain' \ | ||
--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' && \ | ||
echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IC9vcHQvZnJlZXN1cmZlci9saWNlbnNlLnR4dAo=" | base64 -d | sh | ||
|
||
# Set up the environment | ||
ENV OS=Linux \ | ||
|
@@ -36,81 +53,55 @@ ENV OS=Linux \ | |
FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast \ | ||
PERL5LIB=/opt/freesurfer/mni/lib/perl5/5.8.5 \ | ||
MNI_PERL5LIB=/opt/freesurfer/mni/lib/perl5/5.8.5 \ | ||
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 | ||
|
||
|
||
# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg) | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& { \ | ||
which gpg \ | ||
|| apt-get install -y --no-install-recommends gnupg \ | ||
; } \ | ||
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr | ||
# so, if we're not running gnupg 1.x, explicitly install dirmngr too | ||
&& { \ | ||
gpg --version | grep -q '^gpg (GnuPG) 1\.' \ | ||
|| apt-get install -y --no-install-recommends dirmngr \ | ||
; } \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# apt-key is a bit finicky during "docker build" with gnupg 2.x, so install the repo key the same way debian-archive-keyring does (/etc/apt/trusted.gpg.d) | ||
# this makes "apt-key list" output prettier too! | ||
RUN set -x \ | ||
&& export GNUPGHOME="$(mktemp -d)" \ | ||
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys DD95CC430502E37EF840ACEEA5D32F012649A5A9 \ | ||
&& gpg --export DD95CC430502E37EF840ACEEA5D32F012649A5A9 > /etc/apt/trusted.gpg.d/neurodebian.gpg \ | ||
&& rm -rf "$GNUPGHOME" \ | ||
&& apt-key list | grep neurodebian | ||
|
||
RUN { \ | ||
echo 'deb http://neuro.debian.net/debian trusty main'; \ | ||
echo 'deb http://neuro.debian.net/debian data main'; \ | ||
echo '#deb-src http://neuro.debian.net/debian-devel trusty main'; \ | ||
} > /etc/apt/sources.list.d/neurodebian.sources.list | ||
|
||
RUN sed -i -e 's,main *$,main contrib non-free,g' /etc/apt/sources.list.d/neurodebian.sources.list; grep -q 'deb .* multiverse$' /etc/apt/sources.list || sed -i -e 's,universe *$,universe multiverse,g' /etc/apt/sources.list | ||
|
||
# Install FSL 5.0.9 | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends curl && \ | ||
curl -sSL http://neuro.debian.net/lists/trusty.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \ | ||
apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \ | ||
apt-get update && \ | ||
apt-get install -y fsl-core=5.0.9-4~nd14.04+1 | ||
|
||
# Configure environment | ||
ENV FSLDIR=/usr/share/fsl/5.0 | ||
ENV FSL_DIR="${FSLDIR}" \ | ||
FSLOUTPUTTYPE=NIFTI_GZ \ | ||
PATH=/usr/lib/fsl/5.0:$PATH \ | ||
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 \ | ||
FSLOUTPUTTYPE=NIFTI_GZ | ||
|
||
RUN echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IC9vcHQvZnJlZXN1cmZlci9saWNlbnNlLnR4dAo=" | base64 -d | sh | ||
|
||
# Install Connectome Workbench | ||
RUN apt-get update && apt-get -y install connectome-workbench=1.2.3-1~nd14.04+1 | ||
|
||
ENV CARET7DIR=/usr/bin | ||
PATH=/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH | ||
|
||
# Install MCR 2016b | ||
ENV MATLABCMD="/opt/matlabmcr-2016b/v91/toolbox/matlab" \ | ||
MATLAB_COMPILER_RUNTIME="/opt/matlabmcr-2016b/v91" \ | ||
LD_LIBRARY_PATH="/opt/matlabmcr-2016b/v91/runtime/glnxa64:/opt/matlabmcr-2016b/v91/bin/glnxa64:/opt/matlabmcr-2016b/v91/sys/os/glnxa64:$LD_LIBRARY_PATH" | ||
|
||
RUN apt-get update -qq \ | ||
&& apt-get install -y -q --no-install-recommends \ | ||
libxext6 \ | ||
libxpm-dev \ | ||
libxt6 \ | ||
unzip \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& echo "Downloading MATLAB Compiler Runtime ..." \ | ||
&& curl -fsSL --retry 5 -o /tmp/mcr.zip https://ssd.mathworks.com/supportfiles/downloads/R2016b/deployment_files/R2016b/installers/glnxa64/MCR_R2016b_glnxa64_installer.zip \ | ||
&& unzip -q /tmp/mcr.zip -d /tmp/mcrtmp \ | ||
&& /tmp/mcrtmp/install -destinationFolder /opt/matlabmcr-2016b -mode silent -agreeToLicense yes \ | ||
&& rm -rf /tmp/* | ||
|
||
# Install miniconda2 | ||
ENV PATH="/usr/local/miniconda/bin:$PATH" | ||
RUN curl -fsSLO https://repo.continuum.io/miniconda/Miniconda2-4.5.4-Linux-x86_64.sh && \ | ||
bash Miniconda2-4.5.4-Linux-x86_64.sh -b -p /usr/local/miniconda && \ | ||
rm Miniconda2-4.5.4-Linux-x86_64.sh && \ | ||
conda config --add channels conda-forge && \ | ||
conda install -y mkl mkl-service numpy nibabel pandas && sync && \ | ||
conda clean -tipsy && sync && \ | ||
pip install --no-cache-dir pybids[analysis]==0.6.3 | ||
|
||
# Install connectome-workbench | ||
WORKDIR /opt | ||
RUN wget -q https://ftp.humanconnectome.org/workbench/workbench-linux64-v1.3.0.zip -O wb.zip \ | ||
&& unzip wb.zip \ | ||
&& rm wb.zip | ||
ENV CARET7DIR="/opt/workbench/bin_linux64" | ||
|
||
# Install HCP Pipelines and MSM binaries | ||
WORKDIR /opt | ||
RUN apt-get -y update \ | ||
&& apt-get install -y --no-install-recommends python-numpy && \ | ||
wget -q https://github.com/Washington-University/Pipelines/archive/v3.17.0.tar.gz -O pipelines.tar.gz && \ | ||
tar zxf pipelines.tar.gz && \ | ||
mv /opt/Pipelines-* /opt/HCP-Pipelines && \ | ||
rm pipelines.tar.gz && \ | ||
wget -q https://www.doc.ic.ac.uk/~ecr05/MSM_HOCR_v1/MSM_HOCR_v1-download.tgz -O MSMs.tar.gz && \ | ||
tar zxf MSMs.tar.gz && \ | ||
rm MSMs.tar.gz && \ | ||
mv MSM_HOCR_v1/Ubuntu /opt/HCP-Pipelines/MSMBinaries && \ | ||
rm -rf MSM_HOCR_v1 | ||
RUN apt-get -qq update && \ | ||
apt-get install -yq --no-install-recommends gcc g++ libglu1 && \ | ||
rm -rf /tmp/* && \ | ||
wget -qO- https://github.com/Washington-University/Pipelines/archive/v3.26.1.tar.gz | tar xz -C /tmp && \ | ||
mv /tmp/* /opt/HCP-Pipelines && \ | ||
rm -rf /tmp/* && \ | ||
wget -qO- https://www.doc.ic.ac.uk/~ecr05/MSM_HOCR_v2/MSM_HOCR_v2-download.tgz | tar xz -C /tmp && \ | ||
mv /tmp/homes/ecr05/MSM_HOCR_v2/Ubuntu /opt/HCP-Pipelines/MSMBinaries && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
WORKDIR / | ||
|
||
|
@@ -128,23 +119,48 @@ ENV HCPPIPEDIR_Templates=${HCPPIPEDIR}/global/templates \ | |
HCPPIPEDIR_dMRITract=${HCPPIPEDIR}/DiffusionTractography/scripts \ | ||
HCPPIPEDIR_Global=${HCPPIPEDIR}/global/scripts \ | ||
HCPPIPEDIR_tfMRIAnalysis=${HCPPIPEDIR}/TaskfMRIAnalysis/scripts \ | ||
MSMBin=${HCPPIPEDIR}/MSMBinaries | ||
MSMBINDIR=${HCPPIPEDIR}/MSMBinaries \ | ||
MSMCONFIGDIR=${HCPPIPEDIR}/MSMConfig | ||
|
||
## Install the validator | ||
RUN wget -qO- https://deb.nodesource.com/setup_10.x | bash - && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends nodejs && \ | ||
npm install -g [email protected] && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Install FSL 5.0.9 now to ensure it is not removed | ||
RUN apt-get update && \ | ||
apt-get install -y curl && \ | ||
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ | ||
apt-get remove -y curl && \ | ||
apt-get install -y nodejs | ||
apt-get install -y fsl=5.0.9-4~nd80+1 && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Configure environment | ||
ENV FSLDIR=/usr/share/fsl/5.0 | ||
ENV FSL_DIR="${FSLDIR}" \ | ||
FSLOUTPUTTYPE=NIFTI_GZ \ | ||
PATH=/usr/lib/fsl/5.0:$PATH \ | ||
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 \ | ||
FSLOUTPUTTYPE=NIFTI_GZ | ||
|
||
# upgrade our libstdc++ | ||
RUN echo "deb http://ftp.de.debian.org/debian stretch main" >> /etc/apt/sources.list && \ | ||
apt-get update && \ | ||
apt-get install -y libstdc++6 | ||
|
||
RUN npm install -g [email protected] | ||
# overwrite matlab mcr shared object | ||
RUN rm /opt/matlabmcr-2016b/v91/sys/os/glnxa64/libstdc++.so.6 && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/matlabmcr-2016b/v91/sys/os/glnxa64/libstdc++.so.6 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends python-pip python-six python-nibabel python-setuptools | ||
RUN pip install pybids==0.5.1 | ||
ENV PYTHONPATH="" | ||
# install gradient_unwarp.py (v1.0.3) | ||
RUN pip install https://github.com/Washington-University/gradunwarp/archive/v1.0.3.zip | ||
|
||
COPY run.py /run.py | ||
COPY run.py version / | ||
RUN chmod +x /run.py | ||
|
||
COPY version /version | ||
ENTRYPOINT ["/run.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters