Skip to content

Commit b5eae12

Browse files
authored
Merge pull request #1527 from oesteban/pin/niworkflows-0.8
REL: 1.3.1
2 parents 84344a8 + cfc689a commit b5eae12

File tree

8 files changed

+77
-58
lines changed

8 files changed

+77
-58
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ jobs:
389389
sudo setfacl -d -m group:$(id -gn):rwx /tmp/ds005/work && \
390390
sudo setfacl -m group:$(id -gn):rwx /tmp/ds005/work
391391
fmriprep-docker -i poldracklab/fmriprep:latest \
392-
-e FMRIPREP_DEV 1 \
392+
-e FMRIPREP_DEV 1 -u $(id -u) \
393393
--config $PWD/nipype.cfg -w /tmp/ds005/work \
394394
/tmp/data/ds005 /tmp/ds005/derivatives participant \
395395
--sloppy --write-graph --mem_mb 4096 \
@@ -408,7 +408,7 @@ jobs:
408408
sudo setfacl -d -m group:$(id -gn):rwx /tmp/ds005/work && \
409409
sudo setfacl -m group:$(id -gn):rwx /tmp/ds005/work
410410
fmriprep-docker -i poldracklab/fmriprep:latest \
411-
-e FMRIPREP_DEV 1 \
411+
-e FMRIPREP_DEV 1 -u $(id -u) \
412412
--config $PWD/nipype.cfg -w /tmp/ds005/work \
413413
/tmp/data/ds005 /tmp/ds005/derivatives participant \
414414
--sloppy --write-graph --use-syn-sdc --mem_mb 4096 \
@@ -437,7 +437,7 @@ jobs:
437437
command: |
438438
rm /tmp/data/ds005/sub-01/func/*_run-01_*
439439
fmriprep-docker -i poldracklab/fmriprep:latest \
440-
-e FMRIPREP_DEV 1 \
440+
-e FMRIPREP_DEV 1 -u $(id -u) \
441441
--config $PWD/nipype.cfg -w /tmp/ds005/work_partial \
442442
/tmp/data/ds005 /tmp/ds005/derivatives_partial participant \
443443
--sloppy --write-graph --use-syn-sdc --mem_mb 4096 \

CHANGES.rst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1+
1.3.0.post3 (March 1, 2019)
2+
===========================
3+
4+
Hotfix release intended for Docker users, smoothing the experience of TemplateFlow
5+
when using the ``-u UID`` flag is necessary.
6+
7+
* [FIX] Orientation problem with niworkflows<0.7.2 (poldracklab/niworkflows#312) @effigies
8+
* [ENH] TemplateFlow + ``docker run -u ...`` (#1525) @oesteban
9+
* [ENH] Include repetition time in functional summary (#1508) @wiheto
10+
* [FIX] Do not crash if all aroma components are classified as noise (#1467) @jdkent
11+
12+
1.3.0.post2 (February 14, 2019)
13+
===============================
14+
15+
Hotfix release intended for Singularity users, amending the previous iteration
16+
that didn't fix the problem (#1510) @effigies.
17+
118
1.3.0.post1 (February 8, 2019)
219
==============================
320

4-
Hotfix release intended for Singularity users. For further detail, please see
21+
Hotfix release intended for Singularity users. For further detail, please see
522
`#1500 <https://github.com/poldracklab/fmriprep/issues/1500>`__.
623

724
1.3.0 (February 7, 2019)
825
========================
926

1027
We start the 1.3.x series including a few bugfixes, housekeeping duty and a refactors
1128
to leverage `sMRIPrep <https://github.com/poldracklab/smriprep>`__ (which is a fork of
12-
fMRIPrep's anatomical workflow), pybids>=0.7 for querying dataset, and
29+
fMRIPrep's anatomical workflow), pybids>=0.7 for querying dataset, and
1330
`TemplateFlow <https://github.com/templateflow>`__ for handling standard spaces.
1431

1532
* [FIX] Bad ``fsnative`` replacement in CIfTI workflow (#1476) @oesteban
@@ -71,7 +88,7 @@ Hotfix release.
7188
1.2.4 (December 3, 2018)
7289
========================
7390

74-
Bugfixes, an additional iteration over Sentry reporting and some relevant ME-EPI updates
91+
Bugfixes, an additional iteration over Sentry reporting and some relevant ME-EPI updates
7592
(with thanks to @emdupre).
7693

7794
* [ENH] Update ME-EPI workflow to create optimal combination (#1263) @emdupre
@@ -153,7 +170,7 @@ With many thanks to Ali Cohen, James Kent, Inge Amlien, Sebastian Urchs, and Zhi
153170
* [TST] Add heavily-nonuniform boldrefs for regression tests (#1329) @oesteban
154171
* [TST] Fix expectations for CIFTI outputs & ds005 (#1344) @oesteban
155172
* [MAINT] Ignore project settings files from popular python/code editors (#1336) @jdkent
156-
* [CI] Deploy poldracklab/fmriprep:unstable tracking master (#1307) @effigies
173+
* [CI] Deploy poldracklab/fmriprep:unstable tracking master (#1307) @effigies
157174

158175
1.1.8 (October 4, 2018)
159176
=======================

Dockerfile

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM ubuntu:xenial-20161213
33

44
# Pre-cache neurodebian key
5-
COPY docker/files/neurodebian.gpg /root/.neurodebian.gpg
5+
COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg
66

77
# Prepare environment
88
RUN apt-get update && \
@@ -67,7 +67,7 @@ ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
6767

6868
# Installing Neurodebian packages (FSL, AFNI, git)
6969
RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
70-
apt-key add /root/.neurodebian.gpg && \
70+
apt-key add /usr/local/etc/neurodebian.gpg && \
7171
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true)
7272

7373
RUN apt-get update && \
@@ -98,6 +98,11 @@ RUN mkdir -p $ANTSPATH && \
9898
| tar -xzC $ANTSPATH --strip-components 1
9999
ENV PATH=$ANTSPATH:$PATH
100100

101+
# Create a shared $HOME directory
102+
RUN useradd -m -s /bin/bash -G users fmriprep
103+
WORKDIR /home/fmriprep
104+
ENV HOME="/home/fmriprep"
105+
101106
# Installing SVGO
102107
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
103108
RUN apt-get install -y nodejs
@@ -142,41 +147,30 @@ RUN conda install -y python=3.7.1 \
142147
zlib; sync && \
143148
chmod -R a+rX /usr/local/miniconda; sync && \
144149
chmod +x /usr/local/miniconda/bin/*; sync && \
145-
conda clean --all -y; sync && \
150+
conda build purge-all; sync && \
146151
conda clean -tipsy && sync
147152

148-
# Precaching fonts, set 'Agg' as default backend for matplotlib
149-
RUN python -c "from matplotlib import font_manager" && \
150-
sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
151-
RUN pip install "datalad==0.10.0" && \
152-
rm -rf ~/.cache/pip
153-
154153
# Unless otherwise specified each process should only use one thread - nipype
155154
# will handle parallelization
156155
ENV MKL_NUM_THREADS=1 \
157156
OMP_NUM_THREADS=1
158157

158+
# Precaching fonts, set 'Agg' as default backend for matplotlib
159+
RUN python -c "from matplotlib import font_manager" && \
160+
sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
161+
159162
# Precaching atlases
160-
RUN git config --global user.name "fMRIPrep User" && \
161-
git config --global user.email "[email protected]"
162-
ENV TEMPLATEFLOW_HOME="/opt/templateflow"
163-
WORKDIR /opt
164-
RUN datalad install -r https://github.com/templateflow/templateflow.git
165-
RUN datalad get $TEMPLATEFLOW_HOME/tpl-MNI152NLin2009cAsym/* \
166-
$TEMPLATEFLOW_HOME/tpl-MNI152Lin/* \
167-
$TEMPLATEFLOW_HOME/tpl-OASIS30ANTs/* \
168-
$TEMPLATEFLOW_HOME/tpl-NKI/*
169-
RUN git -C $TEMPLATEFLOW_HOME config annex.merge-annex-branches false && \
170-
git -C $TEMPLATEFLOW_HOME/tpl-MNI152NLin2009cAsym config annex.merge-annex-branches false && \
171-
git -C $TEMPLATEFLOW_HOME/tpl-MNI152Lin config annex.merge-annex-branches false && \
172-
git -C $TEMPLATEFLOW_HOME/tpl-OASIS30ANTs config annex.merge-annex-branches false && \
173-
git -C $TEMPLATEFLOW_HOME/tpl-NKI config annex.merge-annex-branches false
163+
RUN pip install --no-cache-dir "templateflow>=0.1.0,<0.2.0a0" && \
164+
python -c "from templateflow import api as tfapi; \
165+
tfapi.get('MNI152Lin'); \
166+
tfapi.get('MNI152NLin2009cAsym'); \
167+
tfapi.get('OASIS30ANTs'); \
168+
tfapi.get('NKI');"
174169

175170
# Installing dev requirements (packages that are not in pypi)
176171
WORKDIR /src/
177172
COPY requirements.txt requirements.txt
178-
RUN pip install -r requirements.txt && \
179-
rm -rf ~/.cache/pip
173+
RUN pip install --no-cache-dir -r requirements.txt
180174

181175
# Installing FMRIPREP
182176
COPY . /src/fmriprep
@@ -185,13 +179,15 @@ ARG VERSION
185179
RUN echo "${VERSION}" > /src/fmriprep/fmriprep/VERSION && \
186180
echo "include fmriprep/VERSION" >> /src/fmriprep/MANIFEST.in && \
187181
cd /src/fmriprep && \
188-
pip install .[all] && \
189-
rm -rf ~/.cache/pip
182+
pip install --no-cache-dir .[all]
190183

191184
RUN install -m 0755 \
192185
/src/fmriprep/scripts/generate_reference_mask.py \
193186
/usr/local/bin/generate_reference_mask
194187

188+
RUN find $HOME -type d -exec chmod go=u {} + && \
189+
find $HOME -type f -exec chmod go=u {} +
190+
195191
ENV IS_DOCKER_8395080871=1
196192

197193
RUN ldconfig

fmriprep/__about__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,17 @@
8888
'nibabel>=2.2.1',
8989
'nilearn',
9090
'nipype>=1.1.6',
91-
'nitime',
92-
'niworkflows>=0.7.2,<0.8.0a0',
91+
'niworkflows<0.9.0a0,>=0.8.0',
9392
'numpy',
9493
'pandas',
9594
'psutil>=5.4',
96-
'pybids>=0.7.0,<0.8.0a0',
95+
'pybids<0.8.0a0,>=0.7.1',
9796
'pyyaml',
9897
'scikit-image',
99-
'smriprep>=0.0.5,<0.1.0a0',
98+
'smriprep<0.2.0a0,>=0.1.0',
10099
'statsmodels',
101100
'tedana>=0.0.5',
102-
'templateflow>=0.0.4',
101+
'templateflow<0.2.0a0,>=0.1.0',
103102
]
104103

105104

fmriprep/workflows/bold/confounds.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ def init_carpetplot_wf(mem_gb, metadata, name="bold_carpet_wf"):
360360
# Warp segmentation into EPI space
361361
resample_parc = pe.Node(ApplyTransforms(
362362
float=True,
363-
input_image=get_template('MNI152NLin2009cAsym',
364-
'_res-01_desc-carpet_dseg.nii.gz'),
363+
input_image=str(get_template(
364+
'MNI152NLin2009cAsym', resolution=1, desc='carpet',
365+
suffix='dseg', extensions=['.nii', '.nii.gz'])),
365366
dimension=3, default_value=0, interpolation='MultiLabel'),
366367
name='resample_parc')
367368

@@ -536,7 +537,9 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads,
536537
freesurfer=False,
537538
mem_gb=mem_gb,
538539
omp_nthreads=omp_nthreads,
539-
template_out_grid=get_template('MNI152Lin', 'res-02_T1w.nii.gz'),
540+
template_out_grid=str(get_template(
541+
'MNI152Lin', resolution=2, desc=None, suffix='T1w',
542+
extensions=['.nii', '.nii.gz'])),
540543
use_compression=False,
541544
use_fieldwarp=use_fieldwarp,
542545
name='bold_mni_trans_wf'

fmriprep/workflows/bold/resampling.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ def _aslist(in_value):
282282

283283
gen_ref = pe.Node(GenerateSamplingReference(), name='gen_ref',
284284
mem_gb=0.3) # 256x256x256 * 64 / 8 ~ 150MB)
285-
gen_ref.inputs.fixed_image = get_template(template, '_res-01_T1w.nii.gz')
285+
gen_ref.inputs.fixed_image = str(get_template(
286+
template, resolution=1, desc=None, suffix='T1w',
287+
extensions=['.nii', '.nii.gz']))
286288

287289
mask_mni_tfm = pe.Node(
288290
ApplyTransforms(interpolation='MultiLabel', float=True),
@@ -342,10 +344,11 @@ def _aslist(in_value):
342344
])
343345
elif template_out_grid in ['1mm', '2mm']:
344346
res = int(template_out_grid[0])
345-
mask_mni_tfm.inputs.reference_image = get_template(
346-
template, '_res-%02d_desc-brain_mask.nii.gz' % res)
347-
bold_to_mni_transform.inputs.reference_image = get_template(
348-
template, '_res-%02d_T1w.nii.gz' % res)
347+
mask_mni_tfm.inputs.reference_image = str(get_template(
348+
template, resolution=res, desc='brain', suffix='mask'))
349+
bold_to_mni_transform.inputs.reference_image = str(get_template(
350+
template, resolution=res, desc=None, suffix='T1w',
351+
extensions=['.nii', '.nii.gz']))
349352
else:
350353
mask_mni_tfm.inputs.reference_image = template_out_grid
351354
bold_to_mni_transform.inputs.reference_image = template_out_grid
@@ -373,11 +376,13 @@ def _aslist(in_value):
373376
(gen_ref, aparc_mni_tfm, [('out_file', 'reference_image')]),
374377
])
375378
elif template_out_grid in ['1mm', '2mm']:
376-
res = int(template_out_grid[0])
377-
aseg_mni_tfm.inputs.reference_image = get_template(
378-
template, '_res-%02d_desc-brain_mask.nii.gz' % res)
379-
aparc_mni_tfm.inputs.reference_image = get_template(
380-
template, '_res-%02d_desc-brain_mask.nii.gz' % res)
379+
entities = {'resolution': int(template_out_grid[0]),
380+
'desc': 'brain', 'suffix': 'mask',
381+
'extensions': ['.nii', '.nii.gz']}
382+
aseg_mni_tfm.inputs.reference_image = str(
383+
get_template(template, **entities))
384+
aparc_mni_tfm.inputs.reference_image = str(
385+
get_template(template, **entities))
381386
else:
382387
aseg_mni_tfm.inputs.reference_image = template_out_grid
383388
aparc_mni_tfm.inputs.reference_image = template_out_grid

fmriprep/workflows/bold/util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ def init_enhance_and_skullstrip_bold_wf(
275275
apply_mask = pe.Node(fsl.ApplyMask(), name='apply_mask')
276276

277277
if not pre_mask:
278-
bold_template = get_template('MNI152NLin2009cAsym', 'res-02_desc-fMRIPrep_boldref.nii.gz')
279-
brain_mask = get_template('MNI152NLin2009cAsym', 'res-02_desc-brain_mask.nii.gz')
278+
bold_template = get_template(
279+
'MNI152NLin2009cAsym', resolution=2, desc='fMRIPrep', suffix='boldref')
280+
brain_mask = get_template(
281+
'MNI152NLin2009cAsym', resolution=2, desc='brain', suffix='mask')
280282

281283
# Initialize transforms with antsAI
282284
init_aff = pe.Node(AI(

requirements.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
pybids>=0.7.0,<0.8.0a0
2-
niworkflows>=0.7.2,<0.8.0a0
3-
smriprep>=0.0.5,<0.1.0a0
4-
templateflow>=0.0.4
1+
smriprep<0.2.0a0,>=0.1.0

0 commit comments

Comments
 (0)