Skip to content

Commit

Permalink
Merge pull request #60 from Shotgunosine/master
Browse files Browse the repository at this point in the history
Allow lower resolution T2s
  • Loading branch information
PeerHerholz authored Jun 30, 2020
2 parents d51c7e4 + c0cfb22 commit c87c9c2
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 82 deletions.
71 changes: 47 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Generated by Neurodocker version 0.4.2-3-gf7055a1
# Timestamp: 2020-06-04 13:51:08 UTC
#
# Timestamp: 2020-06-29 18:20:44 UTC
#
# Thank you for using Neurodocker. If you discover any issues
# or ways to improve this software, please submit an issue or
# pull request on our GitHub repository:
#
#
# https://github.com/kaczmarj/neurodocker

FROM ubuntu:xenial
Expand Down Expand Up @@ -48,15 +48,12 @@ RUN apt-get update -qq \
perl-modules \
wget \
curl \
python3 \
python3-pip \
python3-pandas \
python-pip \
libsm-dev \
libx11-dev \
libxt-dev \
libxext-dev \
libglu1-mesa \
libpython2.7-stdlib \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand Down Expand Up @@ -91,7 +88,31 @@ RUN apt-get update -qq \
--exclude='freesurfer/trctrain' \
&& sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT"

RUN bash -c 'pip3 install nibabel pandas==0.21.0'
ENV CONDA_DIR="/opt/miniconda-latest" \
PATH="/opt/miniconda-latest/bin:$PATH"
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
&& echo "Downloading Miniconda installer ..." \
&& conda_installer="/tmp/miniconda.sh" \
&& curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash "$conda_installer" -b -p /opt/miniconda-latest \
&& rm -f "$conda_installer" \
&& conda update -yq -nbase conda \
&& conda config --system --prepend channels conda-forge \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
&& sync && conda clean -tipsy && sync \
&& conda install -y -q --name base \
'python=3' \
'pip' \
'pandas' \
'setuptools' \
'pandas=0.21.0' \
&& sync && conda clean -tipsy && sync \
&& bash -c "source activate base \
&& pip install --no-cache-dir \
'nibabel'" \
&& rm -rf ~/.cache/pip/* \
&& sync

RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -'

Expand All @@ -111,8 +132,6 @@ ENV FSLDIR="/usr/share/fsl/5.0" \
FSLTCLSH="/usr/bin/tclsh" \
FSLWISH="/usr/bin/wish"

RUN bash -c 'PATH=/usr/lib/fsl/5.0:$PATH'

ENV OS="Linux" \
FS_OVERRIDE="0" \
FIX_VERTEX_AREA="" \
Expand All @@ -128,7 +147,7 @@ ENV OS="Linux" \
FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \
PERL5LIB="/opt/freesurfer/mni/share/perl5" \
MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \
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="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
PYTHONPATH=""

RUN mkdir root/matlab && touch root/matlab/startup.m
Expand Down Expand Up @@ -162,16 +181,12 @@ RUN echo '{ \
\n "perl-modules", \
\n "wget", \
\n "curl", \
\n "python3", \
\n "python3-pip", \
\n "python3-pandas", \
\n "python2.7", \
\n "python-pip", \
\n "libsm-dev", \
\n "libx11-dev", \
\n "libxt-dev", \
\n "libxext-dev", \
\n "libglu1-mesa" \
\n "libglu1-mesa", \
\n "libpython2.7-stdlib" \
\n ] \
\n ], \
\n [ \
Expand All @@ -182,8 +197,20 @@ RUN echo '{ \
\n } \
\n ], \
\n [ \
\n "run_bash", \
\n "pip3 install nibabel pandas==0.21.0" \
\n "miniconda", \
\n { \
\n "use_env": "base", \
\n "conda_install": [ \
\n "python=3", \
\n "pip", \
\n "pandas", \
\n "setuptools", \
\n "pandas=0.21.0" \
\n ], \
\n "pip_install": [ \
\n "nibabel" \
\n ] \
\n } \
\n ], \
\n [ \
\n "run_bash", \
Expand Down Expand Up @@ -212,10 +239,6 @@ RUN echo '{ \
\n } \
\n ], \
\n [ \
\n "run_bash", \
\n "PATH=/usr/lib/fsl/5.0:$PATH" \
\n ], \
\n [ \
\n "env", \
\n { \
\n "OS": "Linux", \
Expand All @@ -233,7 +256,7 @@ RUN echo '{ \
\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \
\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \
\n "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", \
\n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \
\n "PYTHONPATH": "" \
\n } \
\n ], \
Expand Down
74 changes: 49 additions & 25 deletions Singularity
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Generated by Neurodocker version 0.4.2-3-gf7055a1
# Timestamp: 2020-06-04 13:51:09 UTC
#
# Timestamp: 2020-06-29 18:20:45 UTC
#
# Thank you for using Neurodocker. If you discover any issues
# or ways to improve this software, please submit an issue or
# pull request on our GitHub repository:
#
#
# https://github.com/kaczmarj/neurodocker

Bootstrap: docker
Expand Down Expand Up @@ -43,15 +43,12 @@ apt-get install -y -q --no-install-recommends \
perl-modules \
wget \
curl \
python3 \
python3-pip \
python3-pandas \
python-pip \
libsm-dev \
libx11-dev \
libxt-dev \
libxext-dev \
libglu1-mesa
libglu1-mesa \
libpython2.7-stdlib
apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand Down Expand Up @@ -84,7 +81,30 @@ curl -fsSL --retry 5 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/
--exclude='freesurfer/trctrain'
sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT"

bash -c 'pip3 install nibabel pandas==0.21.0'
export PATH="/opt/miniconda-latest/bin:$PATH"
echo "Downloading Miniconda installer ..."
conda_installer="/tmp/miniconda.sh"
curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash "$conda_installer" -b -p /opt/miniconda-latest
rm -f "$conda_installer"
conda update -yq -nbase conda
conda config --system --prepend channels conda-forge
conda config --system --set auto_update_conda false
conda config --system --set show_channel_urls true
sync && conda clean -tipsy && sync
conda install -y -q --name base \
'python=3' \
'pip' \
'pandas' \
'setuptools' \
'pandas=0.21.0'
sync && conda clean -tipsy && sync
bash -c "source activate base
pip install --no-cache-dir \
'nibabel'"
rm -rf ~/.cache/pip/*
sync


bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -'

Expand All @@ -96,8 +116,6 @@ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

bash -c 'npm install -g [email protected]'

bash -c 'PATH=/usr/lib/fsl/5.0:$PATH'

mkdir root/matlab && touch root/matlab/startup.m

mkdir /scratch
Expand Down Expand Up @@ -130,16 +148,12 @@ echo '{
\n "perl-modules",
\n "wget",
\n "curl",
\n "python3",
\n "python3-pip",
\n "python3-pandas",
\n "python2.7",
\n "python-pip",
\n "libsm-dev",
\n "libx11-dev",
\n "libxt-dev",
\n "libxext-dev",
\n "libglu1-mesa"
\n "libglu1-mesa",
\n "libpython2.7-stdlib"
\n ]
\n ],
\n [
Expand All @@ -150,8 +164,20 @@ echo '{
\n }
\n ],
\n [
\n "run_bash",
\n "pip3 install nibabel pandas==0.21.0"
\n "miniconda",
\n {
\n "use_env": "base",
\n "conda_install": [
\n "python=3",
\n "pip",
\n "pandas",
\n "setuptools",
\n "pandas=0.21.0"
\n ],
\n "pip_install": [
\n "nibabel"
\n ]
\n }
\n ],
\n [
\n "run_bash",
Expand Down Expand Up @@ -180,10 +206,6 @@ echo '{
\n }
\n ],
\n [
\n "run_bash",
\n "PATH=/usr/lib/fsl/5.0:$PATH"
\n ],
\n [
\n "env",
\n {
\n "OS": "Linux",
Expand All @@ -201,7 +223,7 @@ echo '{
\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast",
\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5",
\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/",
\n "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",
\n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
\n "PYTHONPATH": ""
\n }
\n ],
Expand Down Expand Up @@ -248,6 +270,8 @@ export LC_ALL="en_US.UTF-8"
export ND_ENTRYPOINT="/neurodocker/startup.sh"
export FREESURFER_HOME="/opt/freesurfer"
export PATH="/opt/freesurfer/bin:$PATH"
export CONDA_DIR="/opt/miniconda-latest"
export PATH="/opt/miniconda-latest/bin:$PATH"
export FSLDIR="/usr/share/fsl/5.0"
export FSLOUTPUTTYPE="NIFTI_GZ"
export FSLMULTIFILEQUIT="TRUE"
Expand All @@ -270,7 +294,7 @@ export MNI_DATAPATH="/opt/freesurfer/mni/data"
export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast"
export PERL5LIB="/opt/freesurfer/mni/share/perl5"
export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/"
export 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"
export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export PYTHONPATH=""

%files
Expand Down
16 changes: 6 additions & 10 deletions generate_freesurfer_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,22 @@ docker run --rm ${image} generate docker \
--base ubuntu:xenial \
--pkg-manager apt \
--install tcsh bc tar libgomp1 perl-modules wget curl \
python3 python3-pip python3-pandas python-pip \
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa \
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\
--freesurfer version=6.0.1 install_path=/opt/freesurfer \
--run-bash 'pip3 install nibabel pandas==0.21.0' \
--miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \
--run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \
--install nodejs \
--run-bash 'npm install -g [email protected]' \
--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 FSLOUTPUTTYPE=NIFTI_GZ \
--run-bash 'PATH=/usr/lib/fsl/5.0:$PATH' \
--env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \
FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \
FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \
MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \
FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \
MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \
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=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PYTHONPATH="" \
--run 'mkdir root/matlab && touch root/matlab/startup.m' \
--run 'mkdir /scratch' \
Expand All @@ -80,24 +78,22 @@ docker run --rm ${image} generate singularity \
--base ubuntu:xenial \
--pkg-manager apt \
--install tcsh bc tar libgomp1 perl-modules wget curl \
python3 python3-pip python3-pandas python-pip \
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa \
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\
--freesurfer version=6.0.1 install_path=/opt/freesurfer \
--run-bash 'pip3 install nibabel pandas==0.21.0' \
--miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \
--run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \
--install nodejs \
--run-bash 'npm install -g [email protected]' \
--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 FSLOUTPUTTYPE=NIFTI_GZ \
--run-bash 'PATH=/usr/lib/fsl/5.0:$PATH' \
--env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \
FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \
FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \
MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \
FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \
MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \
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=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PYTHONPATH="" \
--run 'mkdir root/matlab && touch root/matlab/startup.m' \
--run 'mkdir /scratch' \
Expand Down
Loading

0 comments on commit c87c9c2

Please sign in to comment.