Skip to content

Commit c87c9c2

Browse files
authored
Merge pull request #60 from Shotgunosine/master
Allow lower resolution T2s
2 parents d51c7e4 + c0cfb22 commit c87c9c2

File tree

4 files changed

+139
-82
lines changed

4 files changed

+139
-82
lines changed

Dockerfile

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Generated by Neurodocker version 0.4.2-3-gf7055a1
2-
# Timestamp: 2020-06-04 13:51:08 UTC
3-
#
2+
# Timestamp: 2020-06-29 18:20:44 UTC
3+
#
44
# Thank you for using Neurodocker. If you discover any issues
55
# or ways to improve this software, please submit an issue or
66
# pull request on our GitHub repository:
7-
#
7+
#
88
# https://github.com/kaczmarj/neurodocker
99

1010
FROM ubuntu:xenial
@@ -48,15 +48,12 @@ RUN apt-get update -qq \
4848
perl-modules \
4949
wget \
5050
curl \
51-
python3 \
52-
python3-pip \
53-
python3-pandas \
54-
python-pip \
5551
libsm-dev \
5652
libx11-dev \
5753
libxt-dev \
5854
libxext-dev \
5955
libglu1-mesa \
56+
libpython2.7-stdlib \
6057
&& apt-get clean \
6158
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
6259

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

94-
RUN bash -c 'pip3 install nibabel pandas==0.21.0'
91+
ENV CONDA_DIR="/opt/miniconda-latest" \
92+
PATH="/opt/miniconda-latest/bin:$PATH"
93+
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
94+
&& echo "Downloading Miniconda installer ..." \
95+
&& conda_installer="/tmp/miniconda.sh" \
96+
&& curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
97+
&& bash "$conda_installer" -b -p /opt/miniconda-latest \
98+
&& rm -f "$conda_installer" \
99+
&& conda update -yq -nbase conda \
100+
&& conda config --system --prepend channels conda-forge \
101+
&& conda config --system --set auto_update_conda false \
102+
&& conda config --system --set show_channel_urls true \
103+
&& sync && conda clean -tipsy && sync \
104+
&& conda install -y -q --name base \
105+
'python=3' \
106+
'pip' \
107+
'pandas' \
108+
'setuptools' \
109+
'pandas=0.21.0' \
110+
&& sync && conda clean -tipsy && sync \
111+
&& bash -c "source activate base \
112+
&& pip install --no-cache-dir \
113+
'nibabel'" \
114+
&& rm -rf ~/.cache/pip/* \
115+
&& sync
95116

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

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

114-
RUN bash -c 'PATH=/usr/lib/fsl/5.0:$PATH'
115-
116135
ENV OS="Linux" \
117136
FS_OVERRIDE="0" \
118137
FIX_VERTEX_AREA="" \
@@ -128,7 +147,7 @@ ENV OS="Linux" \
128147
FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \
129148
PERL5LIB="/opt/freesurfer/mni/share/perl5" \
130149
MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \
131-
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" \
150+
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" \
132151
PYTHONPATH=""
133152

134153
RUN mkdir root/matlab && touch root/matlab/startup.m
@@ -162,16 +181,12 @@ RUN echo '{ \
162181
\n "perl-modules", \
163182
\n "wget", \
164183
\n "curl", \
165-
\n "python3", \
166-
\n "python3-pip", \
167-
\n "python3-pandas", \
168-
\n "python2.7", \
169-
\n "python-pip", \
170184
\n "libsm-dev", \
171185
\n "libx11-dev", \
172186
\n "libxt-dev", \
173187
\n "libxext-dev", \
174-
\n "libglu1-mesa" \
188+
\n "libglu1-mesa", \
189+
\n "libpython2.7-stdlib" \
175190
\n ] \
176191
\n ], \
177192
\n [ \
@@ -182,8 +197,20 @@ RUN echo '{ \
182197
\n } \
183198
\n ], \
184199
\n [ \
185-
\n "run_bash", \
186-
\n "pip3 install nibabel pandas==0.21.0" \
200+
\n "miniconda", \
201+
\n { \
202+
\n "use_env": "base", \
203+
\n "conda_install": [ \
204+
\n "python=3", \
205+
\n "pip", \
206+
\n "pandas", \
207+
\n "setuptools", \
208+
\n "pandas=0.21.0" \
209+
\n ], \
210+
\n "pip_install": [ \
211+
\n "nibabel" \
212+
\n ] \
213+
\n } \
187214
\n ], \
188215
\n [ \
189216
\n "run_bash", \
@@ -212,10 +239,6 @@ RUN echo '{ \
212239
\n } \
213240
\n ], \
214241
\n [ \
215-
\n "run_bash", \
216-
\n "PATH=/usr/lib/fsl/5.0:$PATH" \
217-
\n ], \
218-
\n [ \
219242
\n "env", \
220243
\n { \
221244
\n "OS": "Linux", \
@@ -233,7 +256,7 @@ RUN echo '{ \
233256
\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \
234257
\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
235258
\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \
236-
\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", \
259+
\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", \
237260
\n "PYTHONPATH": "" \
238261
\n } \
239262
\n ], \

Singularity

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Generated by Neurodocker version 0.4.2-3-gf7055a1
2-
# Timestamp: 2020-06-04 13:51:09 UTC
3-
#
2+
# Timestamp: 2020-06-29 18:20:45 UTC
3+
#
44
# Thank you for using Neurodocker. If you discover any issues
55
# or ways to improve this software, please submit an issue or
66
# pull request on our GitHub repository:
7-
#
7+
#
88
# https://github.com/kaczmarj/neurodocker
99

1010
Bootstrap: docker
@@ -43,15 +43,12 @@ apt-get install -y -q --no-install-recommends \
4343
perl-modules \
4444
wget \
4545
curl \
46-
python3 \
47-
python3-pip \
48-
python3-pandas \
49-
python-pip \
5046
libsm-dev \
5147
libx11-dev \
5248
libxt-dev \
5349
libxext-dev \
54-
libglu1-mesa
50+
libglu1-mesa \
51+
libpython2.7-stdlib
5552
apt-get clean
5653
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
5754

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

87-
bash -c 'pip3 install nibabel pandas==0.21.0'
84+
export PATH="/opt/miniconda-latest/bin:$PATH"
85+
echo "Downloading Miniconda installer ..."
86+
conda_installer="/tmp/miniconda.sh"
87+
curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
88+
bash "$conda_installer" -b -p /opt/miniconda-latest
89+
rm -f "$conda_installer"
90+
conda update -yq -nbase conda
91+
conda config --system --prepend channels conda-forge
92+
conda config --system --set auto_update_conda false
93+
conda config --system --set show_channel_urls true
94+
sync && conda clean -tipsy && sync
95+
conda install -y -q --name base \
96+
'python=3' \
97+
'pip' \
98+
'pandas' \
99+
'setuptools' \
100+
'pandas=0.21.0'
101+
sync && conda clean -tipsy && sync
102+
bash -c "source activate base
103+
pip install --no-cache-dir \
104+
'nibabel'"
105+
rm -rf ~/.cache/pip/*
106+
sync
107+
88108

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

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

97117
bash -c 'npm install -g bids-validator@0.19.8'
98118

99-
bash -c 'PATH=/usr/lib/fsl/5.0:$PATH'
100-
101119
mkdir root/matlab && touch root/matlab/startup.m
102120

103121
mkdir /scratch
@@ -130,16 +148,12 @@ echo '{
130148
\n "perl-modules",
131149
\n "wget",
132150
\n "curl",
133-
\n "python3",
134-
\n "python3-pip",
135-
\n "python3-pandas",
136-
\n "python2.7",
137-
\n "python-pip",
138151
\n "libsm-dev",
139152
\n "libx11-dev",
140153
\n "libxt-dev",
141154
\n "libxext-dev",
142-
\n "libglu1-mesa"
155+
\n "libglu1-mesa",
156+
\n "libpython2.7-stdlib"
143157
\n ]
144158
\n ],
145159
\n [
@@ -150,8 +164,20 @@ echo '{
150164
\n }
151165
\n ],
152166
\n [
153-
\n "run_bash",
154-
\n "pip3 install nibabel pandas==0.21.0"
167+
\n "miniconda",
168+
\n {
169+
\n "use_env": "base",
170+
\n "conda_install": [
171+
\n "python=3",
172+
\n "pip",
173+
\n "pandas",
174+
\n "setuptools",
175+
\n "pandas=0.21.0"
176+
\n ],
177+
\n "pip_install": [
178+
\n "nibabel"
179+
\n ]
180+
\n }
155181
\n ],
156182
\n [
157183
\n "run_bash",
@@ -180,10 +206,6 @@ echo '{
180206
\n }
181207
\n ],
182208
\n [
183-
\n "run_bash",
184-
\n "PATH=/usr/lib/fsl/5.0:$PATH"
185-
\n ],
186-
\n [
187209
\n "env",
188210
\n {
189211
\n "OS": "Linux",
@@ -201,7 +223,7 @@ echo '{
201223
\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast",
202224
\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5",
203225
\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/",
204-
\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",
226+
\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",
205227
\n "PYTHONPATH": ""
206228
\n }
207229
\n ],
@@ -248,6 +270,8 @@ export LC_ALL="en_US.UTF-8"
248270
export ND_ENTRYPOINT="/neurodocker/startup.sh"
249271
export FREESURFER_HOME="/opt/freesurfer"
250272
export PATH="/opt/freesurfer/bin:$PATH"
273+
export CONDA_DIR="/opt/miniconda-latest"
274+
export PATH="/opt/miniconda-latest/bin:$PATH"
251275
export FSLDIR="/usr/share/fsl/5.0"
252276
export FSLOUTPUTTYPE="NIFTI_GZ"
253277
export FSLMULTIFILEQUIT="TRUE"
@@ -270,7 +294,7 @@ export MNI_DATAPATH="/opt/freesurfer/mni/data"
270294
export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast"
271295
export PERL5LIB="/opt/freesurfer/mni/share/perl5"
272296
export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/"
273-
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"
297+
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"
274298
export PYTHONPATH=""
275299

276300
%files

generate_freesurfer_images.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,22 @@ docker run --rm ${image} generate docker \
4646
--base ubuntu:xenial \
4747
--pkg-manager apt \
4848
--install tcsh bc tar libgomp1 perl-modules wget curl \
49-
python3 python3-pip python3-pandas python-pip \
50-
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa \
49+
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\
5150
--freesurfer version=6.0.1 install_path=/opt/freesurfer \
52-
--run-bash 'pip3 install nibabel pandas==0.21.0' \
51+
--miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \
5352
--run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \
5453
--install nodejs \
5554
--run-bash 'npm install -g bids-validator@0.19.8' \
5655
--env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \
5756
FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \
5857
FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \
59-
--run-bash 'PATH=/usr/lib/fsl/5.0:$PATH' \
6058
--env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \
6159
FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \
6260
FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \
6361
MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \
6462
FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \
6563
MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \
66-
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 \
64+
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 \
6765
PYTHONPATH="" \
6866
--run 'mkdir root/matlab && touch root/matlab/startup.m' \
6967
--run 'mkdir /scratch' \
@@ -80,24 +78,22 @@ docker run --rm ${image} generate singularity \
8078
--base ubuntu:xenial \
8179
--pkg-manager apt \
8280
--install tcsh bc tar libgomp1 perl-modules wget curl \
83-
python3 python3-pip python3-pandas python-pip \
84-
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa \
81+
libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\
8582
--freesurfer version=6.0.1 install_path=/opt/freesurfer \
86-
--run-bash 'pip3 install nibabel pandas==0.21.0' \
83+
--miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \
8784
--run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \
8885
--install nodejs \
8986
--run-bash 'npm install -g bids-validator@0.19.8' \
9087
--env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \
9188
FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \
9289
FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \
93-
--run-bash 'PATH=/usr/lib/fsl/5.0:$PATH' \
9490
--env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \
9591
FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \
9692
FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \
9793
MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \
9894
FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \
9995
MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \
100-
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 \
96+
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 \
10197
PYTHONPATH="" \
10298
--run 'mkdir root/matlab && touch root/matlab/startup.m' \
10399
--run 'mkdir /scratch' \

0 commit comments

Comments
 (0)