Skip to content

Commit dd4201c

Browse files
authored
Merge pull request #1438 from oesteban/rf/niworkflows-upstream
[RF] Use niworkflows upstreamed interfaces and utilities
2 parents ddffc4b + 18168e1 commit dd4201c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+269
-3646
lines changed

.circleci/config.yml

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
apk add --no-cache pigz python3
1616
- restore_cache:
1717
keys:
18-
- docker-v2-{{ .Branch }}-{{ epoch }}
19-
- docker-v2-{{ .Branch }}-
20-
- docker-v2-master-
21-
- docker-v2-
18+
- docker-v3-{{ .Branch }}-{{ epoch }}
19+
- docker-v3-{{ .Branch }}-
20+
- docker-v3-master-
21+
- docker-v3-
2222
paths:
2323
- /tmp/cache/docker.tar.gz
2424
- /tmp/cache/ubuntu.tar.gz
@@ -83,8 +83,8 @@ jobs:
8383
steps:
8484
- restore_cache:
8585
keys:
86-
- data-v5-{{ epoch }}
87-
- data-v5-
86+
- data-v6-{{ epoch }}
87+
- data-v6-
8888
- run:
8989
name: Get test data from ds000005
9090
command: |
@@ -152,7 +152,7 @@ jobs:
152152
- ds054/nipype.cfg
153153
- ds210/nipype.cfg
154154
- save_cache:
155-
key: data-v5-{{ epoch }}
155+
key: data-v6-{{ epoch }}
156156
paths:
157157
- /tmp/data
158158
- /tmp/ds005/derivatives/freesurfer
@@ -165,8 +165,8 @@ jobs:
165165
steps:
166166
- restore_cache:
167167
keys:
168-
- regression-v2-{{ epoch }}
169-
- regression-v2-
168+
- regression-v3-{{ epoch }}
169+
- regression-v3-
170170
- run:
171171
name: Get truncated BOLD series
172172
command: |
@@ -193,7 +193,7 @@ jobs:
193193
paths:
194194
- data
195195
- save_cache:
196-
key: regression-v2-{{ epoch }}
196+
key: regression-v3-{{ epoch }}
197197
paths:
198198
- /tmp/data
199199

@@ -206,7 +206,7 @@ jobs:
206206
- attach_workspace:
207207
at: /tmp
208208
- save_cache:
209-
key: docker-v2-{{ .Branch }}-{{ epoch }}
209+
key: docker-v3-{{ .Branch }}-{{ epoch }}
210210
paths:
211211
- /tmp/cache/docker.tar.gz
212212

@@ -225,12 +225,15 @@ jobs:
225225
echo "Skipping pytest job"
226226
circleci step halt
227227
fi
228+
228229
- attach_workspace:
229230
at: /tmp
230231
- run:
231232
name: Check PyPi preconditions
232233
command: |
233-
pip install "setuptools>=27.0" cython numpy twine future docutils
234+
pyenv global 3.5.2
235+
virtualenv venv
236+
pip install "setuptools>=27.0" cython numpy twine docutils
234237
python setup.py check -r -s
235238
python setup.py sdist
236239
- run:
@@ -306,6 +309,7 @@ jobs:
306309
echo "Skipping pytest job"
307310
circleci step halt
308311
fi
312+
309313
- attach_workspace:
310314
at: /tmp
311315
- run:
@@ -350,14 +354,15 @@ jobs:
350354
echo "Skipping ds000005 build"
351355
circleci step halt
352356
fi
357+
353358
- attach_workspace:
354359
at: /tmp
355360
- restore_cache:
356361
keys:
357-
- ds005-anat-v11-{{ .Branch }}-{{ epoch }}
358-
- ds005-anat-v11-{{ .Branch }}
359-
- ds005-anat-v11-master
360-
- ds005-anat-v11-
362+
- ds005-anat-v12-{{ .Branch }}-{{ epoch }}
363+
- ds005-anat-v12-{{ .Branch }}
364+
- ds005-anat-v12-master
365+
- ds005-anat-v12-
361366
- run:
362367
name: Setting up test
363368
command: |
@@ -391,7 +396,7 @@ jobs:
391396
--sloppy --write-graph --mem_mb 4096 \
392397
--nthreads 2 --anat-only -vv
393398
- save_cache:
394-
key: ds005-anat-v11-{{ .Branch }}-{{ epoch }}
399+
key: ds005-anat-v12-{{ .Branch }}-{{ epoch }}
395400
paths:
396401
- /tmp/ds005/work
397402
- /tmp/ds005/derivatives/fmriprep
@@ -480,14 +485,15 @@ jobs:
480485
echo "Skipping ds000054 build"
481486
circleci step halt
482487
fi
488+
483489
- attach_workspace:
484490
at: /tmp
485491
- restore_cache:
486492
keys:
487-
- ds054-anat-v8-{{ .Branch }}-{{ epoch }}
488-
- ds054-anat-v8-{{ .Branch }}
489-
- ds054-anat-v8-master
490-
- ds054-anat-v8-
493+
- ds054-anat-v10-{{ .Branch }}-{{ epoch }}
494+
- ds054-anat-v10-{{ .Branch }}
495+
- ds054-anat-v10-master
496+
- ds054-anat-v10-
491497
- run:
492498
name: Setting up test
493499
command: |
@@ -521,7 +527,7 @@ jobs:
521527
--fs-no-reconall --sloppy --write-graph \
522528
--mem_mb 4096 --nthreads 2 --anat-only -vv
523529
- save_cache:
524-
key: ds054-anat-v8-{{ .Branch }}-{{ epoch }}
530+
key: ds054-anat-v10-{{ .Branch }}-{{ epoch }}
525531
paths:
526532
- /tmp/ds054/work
527533
- /tmp/ds054/derivatives
@@ -598,14 +604,15 @@ jobs:
598604
echo "Skipping ds000210 build"
599605
circleci step halt
600606
fi
607+
601608
- attach_workspace:
602609
at: /tmp
603610
- restore_cache:
604611
keys:
605-
- ds210-anat-v6-{{ .Branch }}-{{ epoch }}
606-
- ds210-anat-v6-{{ .Branch }}
607-
- ds210-anat-v6-master
608-
- ds210-anat-v6-
612+
- ds210-anat-v8-{{ .Branch }}-{{ epoch }}
613+
- ds210-anat-v8-{{ .Branch }}
614+
- ds210-anat-v8-master
615+
- ds210-anat-v8-
609616
- run:
610617
name: Setting up test
611618
command: |
@@ -639,7 +646,7 @@ jobs:
639646
--fs-no-reconall --sloppy --write-graph \
640647
--mem_mb 4096 --nthreads 2 --anat-only -vv
641648
- save_cache:
642-
key: ds210-anat-v6-{{ .Branch }}-{{ epoch }}
649+
key: ds210-anat-v8-{{ .Branch }}-{{ epoch }}
643650
paths:
644651
- /tmp/ds210/work
645652
- /tmp/ds210/derivatives
@@ -678,6 +685,7 @@ jobs:
678685
image: circleci/classic:201711-01
679686
working_directory: /tmp/src/fmriprep
680687
steps:
688+
681689
- attach_workspace:
682690
at: /tmp
683691
- run:
@@ -716,8 +724,11 @@ jobs:
716724
- run:
717725
name: Deploy to PyPi
718726
command: |
719-
pip install "setuptools>=27.0" cython numpy twine future docutils
727+
pyenv global 3.5.2
728+
virtualenv venv
729+
pip install "setuptools>=27.0" cython numpy twine docutils
720730
echo "${CIRCLE_TAG}" > fmriprep/VERSION
731+
echo "include fmriprep/VERSION" >> MANIFEST.in
721732
python setup.py check -r -s
722733
python setup.py sdist
723734
twine upload dist/*

docs/anat/base.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/api/interfaces.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
autodoc_mock_imports += [
5858
'pandas',
5959
'nilearn',
60-
'seaborn',
6160
]
6261

6362
# Add any paths that contain templates here, relative to this directory.

docs/environment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ dependencies:
1111
- jinja2=2.8
1212
- sphinx>=1.5.1
1313
- sphinx_rtd_theme
14-
- mock
1514
- future
1615
- nibabel
1716
- statsmodels
@@ -29,5 +28,5 @@ dependencies:
2928
- svgutils
3029
- nitime
3130
- nilearn
32-
- niworkflows>=0.5.1,<0.5.2
31+
- niworkflows>=0.5.2.post5,<0.5.3
3332
- tedana>=0.0.5

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
mock
21
pydotplus
32
pydot>=1.2.3
43
-r ../requirements.txt

docs/workflows.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ T1w/T2w preprocessing
7979
num_t1w=1)
8080

8181
The anatomical sub-workflow begins by constructing an average image by
82-
:ref:`conforming <conformation>` all found T1w images to RAS orientation and
82+
conforming all found T1w images to RAS orientation and
8383
a common voxel size, and, in the case of multiple images, averages them into a
8484
single reference template (see `Longitudinal processing`_).
8585

@@ -535,13 +535,13 @@ ICA-AROMA
535535
~~~~~~~~~
536536
:mod:`fmriprep.workflows.bold.confounds.init_ica_aroma_wf`
537537

538-
When one of the `--output-spaces` selected is in MNI space, ICA-AROMA denoising
538+
When one of the `--output-spaces` selected is in MNI space, ICA-AROMA denoising
539539
can be automatically appended to the workflow.
540540
The number of ICA-AROMA components depends on a dimensionality estimate made by MELODIC.
541-
For datasets with a very short TR and a large number of timepoints, this may result
542-
in an unusually high number of components.
543-
By default, dimensionality is limited to a maximum of 200 components.
544-
To override this upper limit one may specify the number of components to be extracted
541+
For datasets with a very short TR and a large number of timepoints, this may result
542+
in an unusually high number of components.
543+
By default, dimensionality is limited to a maximum of 200 components.
544+
To override this upper limit one may specify the number of components to be extracted
545545
with ``--aroma-melodic-dimensionality``.
546546
Further details on the implementation are given within the workflow generation function (:mod:`fmriprep.workflows.bold.confounds.init_ica_aroma_wf`).
547547

fmriprep/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
'nilearn',
9191
'nipype>=1.1.6',
9292
'nitime',
93-
'niworkflows>=0.5.1,<0.5.2',
93+
'niworkflows>=0.5.2.post5,<0.5.3',
9494
'numpy',
9595
'pandas',
9696
'pybids==0.6.5',

fmriprep/cli/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
3-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
4-
# vi: set ft=python sts=4 ts=4 sw=4 et:

fmriprep/cli/run.py

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,9 @@ def build_workflow(opts, retval):
553553
from shutil import copyfile
554554

555555
from nipype import logging, config as ncfg
556+
from niworkflows.utils.bids import collect_participants
556557
from ..__about__ import __version__
557558
from ..workflows.base import init_fmriprep_wf
558-
from ..utils.bids import collect_participants
559559
from ..viz.reports import generate_reports
560560

561561
logger = logging.getLogger('nipype.workflow')
@@ -742,33 +742,38 @@ def build_workflow(opts, retval):
742742

743743
logs_path = Path(output_dir) / 'fmriprep' / 'logs'
744744
boilerplate = retval['workflow'].visit_desc()
745-
(logs_path / 'CITATION.md').write_text(boilerplate)
746-
logger.log(25, 'Works derived from this fMRIPrep execution should '
747-
'include the following boilerplate:\n\n%s', boilerplate)
748-
749-
# Generate HTML file resolving citations
750-
cmd = ['pandoc', '-s', '--bibliography',
751-
pkgrf('fmriprep', 'data/boilerplate.bib'),
752-
'--filter', 'pandoc-citeproc',
753-
str(logs_path / 'CITATION.md'),
754-
'-o', str(logs_path / 'CITATION.html')]
755-
try:
756-
check_call(cmd, timeout=10)
757-
except (FileNotFoundError, CalledProcessError, TimeoutExpired):
758-
logger.warning('Could not generate CITATION.html file:\n%s',
759-
' '.join(cmd))
760-
761-
# Generate LaTex file resolving citations
762-
cmd = ['pandoc', '-s', '--bibliography',
763-
pkgrf('fmriprep', 'data/boilerplate.bib'),
764-
'--natbib', str(logs_path / 'CITATION.md'),
765-
'-o', str(logs_path / 'CITATION.tex')]
766-
try:
767-
check_call(cmd, timeout=10)
768-
copyfile(pkgrf('fmriprep', 'data/boilerplate.bib'), str(logs_path / 'CITATION.bib'))
769-
except (FileNotFoundError, CalledProcessError, TimeoutExpired):
770-
logger.warning('Could not generate CITATION.tex file:\n%s',
771-
' '.join(cmd))
745+
746+
if boilerplate:
747+
(logs_path / 'CITATION.md').write_text(boilerplate)
748+
logger.log(25, 'Works derived from this fMRIPrep execution should '
749+
'include the following boilerplate:\n\n%s', boilerplate)
750+
751+
# Generate HTML file resolving citations
752+
cmd = ['pandoc', '-s', '--bibliography',
753+
pkgrf('fmriprep', 'data/boilerplate.bib'),
754+
'--filter', 'pandoc-citeproc',
755+
str(logs_path / 'CITATION.md'),
756+
'-o', str(logs_path / 'CITATION.html')]
757+
try:
758+
check_call(cmd, timeout=10)
759+
except (FileNotFoundError, CalledProcessError, TimeoutExpired):
760+
logger.warning('Could not generate CITATION.html file:\n%s',
761+
' '.join(cmd))
762+
763+
# Generate LaTex file resolving citations
764+
cmd = ['pandoc', '-s', '--bibliography',
765+
pkgrf('fmriprep', 'data/boilerplate.bib'),
766+
'--natbib', str(logs_path / 'CITATION.md'),
767+
'-o', str(logs_path / 'CITATION.tex')]
768+
try:
769+
check_call(cmd, timeout=10)
770+
except (FileNotFoundError, CalledProcessError, TimeoutExpired):
771+
logger.warning('Could not generate CITATION.tex file:\n%s',
772+
' '.join(cmd))
773+
else:
774+
copyfile(pkgrf('fmriprep', 'data/boilerplate.bib'),
775+
(logs_path / 'CITATION.bib'))
776+
772777
return retval
773778

774779

0 commit comments

Comments
 (0)