Skip to content

Commit 92533de

Browse files
authored
Merge pull request #1459 from poldracklab/fix/docs
FIX: ReadTheDocs builds
2 parents 116ae42 + 502a40f commit 92533de

File tree

8 files changed

+73
-10
lines changed

8 files changed

+73
-10
lines changed

.readthedocs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# conda:
22
# file: docs/environment.yml
33
# requirements_file: requirements.txt - this option seems to be ignored by RTD
4-
formats:
5-
- none
4+
build:
5+
image: latest
6+
67
python:
7-
setup_py_install: false
8+
version: 3.6
89
pip_install: true
9-
version: 3.5
10+
use_system_site_packages: true
1011
extra_requirements:
1112
- doc
1213

14+
formats: []

docs/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ dependencies:
2828
- svgutils
2929
- nitime
3030
- nilearn
31-
- niworkflows>=0.5.2.post5,<0.5.3
31+
- git+https://github.com/poldracklab/niworkflows.git@master#egg=niworkflows
3232
- tedana>=0.0.5

fmriprep/__about__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@
9898
'scikit-image',
9999
'statsmodels',
100100
'tedana>=0.0.5',
101+
'psutil>=5.4',
101102
]
102103

103104

104105
LINKS_REQUIRES = [
106+
'git+https://github.com/poldracklab/niworkflows.git@'
107+
'master#egg=niworkflows',
105108
]
106109

107110
TESTS_REQUIRES = [
@@ -121,7 +124,7 @@
121124
'sphinx_rtd_theme',
122125
],
123126
'duecredit': ['duecredit'],
124-
'resmon': ['psutil>=5.4.0'],
127+
'resmon': [],
125128
'sentry': ['sentry-sdk>=0.5.3'],
126129
'tests': TESTS_REQUIRES,
127130
}

fmriprep/data/flirtsch/bbr.sch

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# 1mm scale
2+
setscale 1 force
3+
setoption costfunction bbr
4+
setoption optimisationtype brent
5+
setoption tolerance 0.0005 0.0005 0.0005 0.02 0.02 0.02 0.002 0.002 0.002 0.001 0.001 0.001
6+
#setoption tolerance 0.005 0.005 0.005 0.2 0.2 0.2 0.02 0.02 0.02 0.01 0.01 0.01
7+
setoption boundguess 1
8+
setoption bbrstep 200
9+
clear UA
10+
clear UU
11+
clear UV
12+
clear U
13+
setrowqsform UU
14+
setrow UU 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
15+
measurecost 6 UU:1-2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 rel 8
16+
gridmeasurecost 6 UU:1-2 -0.07 0.07 0.07 -0.07 0.07 0.07 -0.07 0.07 0.07 -4.0 4.0 4.0 -4.0 4.0 4.0 -4.0 4.0 4.0 0.0 0.0 0.0 abs 8
17+
sort U
18+
copy U UA
19+
clear U
20+
optimise 6 UA:1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 rel 8
21+
setoption optimisationtype powell
22+
optimise 6 U:1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 rel 8
23+
setoption optimisationtype brent
24+
optimise 6 U:2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 rel 4
25+
sort U
26+
setoption tolerance 0.0002 0.0002 0.0002 0.02 0.02 0.02 0.002 0.002 0.002 0.001 0.001 0.001
27+
setoption bbrstep 2
28+
clear UU
29+
copy U UU
30+
clear U
31+
gridmeasurecost 6 UU:1 -0.0017 0.0017 0.0017 -0.0017 0.0017 0.0017 -0.0017 0.0017 0.0017 -0.1 0.1 0.1 -0.1 0.1 0.1 -0.1 0.1 0.1 0.0 0.0 0.0 abs 8
32+
sort U
33+
clear UB
34+
copy U UB
35+
clear U
36+
setoption optimisationtype brent
37+
optimise 6 UB:1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 rel 8
38+
setoption optimisationtype powell
39+
optimise 12 U:1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 rel 8
40+
setoption optimisationtype brent
41+
optimise 12 U:2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 rel 4
42+
sort U
43+
print U:1
44+

fmriprep/workflows/bold/registration.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
import os
1717
import os.path as op
1818

19+
import pkg_resources as pkgr
20+
1921
from nipype.pipeline import engine as pe
22+
from nipype import logging
2023
from nipype.interfaces import utility as niu, fsl, c3
2124
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
2225
# See https://github.com/poldracklab/fmriprep/issues/768
@@ -37,6 +40,8 @@
3740

3841
DEFAULT_MEMORY_MIN_GB = 0.01
3942

43+
LOGGER = logging.getLogger('nipype.workflow')
44+
4045

4146
def init_bold_reg_wf(freesurfer, use_bbr, bold2t1w_dof, mem_gb, omp_nthreads,
4247
use_compression=True, write_report=True, name='bold_reg_wf'):
@@ -658,10 +663,17 @@ def init_fsl_bbr_wf(use_bbr, bold2t1w_dof, name='fsl_bbr_wf'):
658663
return workflow
659664

660665
flt_bbr = pe.Node(
661-
FLIRTRPT(cost_func='bbr', dof=bold2t1w_dof, generate_report=True,
662-
schedule=op.join(os.getenv('FSLDIR'), 'etc/flirtsch/bbr.sch')),
666+
FLIRTRPT(cost_func='bbr', dof=bold2t1w_dof, generate_report=True),
663667
name='flt_bbr')
664668

669+
FSLDIR = os.getenv('FSLDIR')
670+
if FSLDIR:
671+
flt_bbr.inputs.schedule = op.join(FSLDIR, 'etc/flirtsch/bbr.sch')
672+
else:
673+
# Should mostly be hit while building docs
674+
LOGGER.warning("FSLDIR unset - using packaged BBR schedule")
675+
flt_bbr.inputs.schedule = pkgr.resource_filename('fmriprep', 'data/flirtsch/bbr.sch')
676+
665677
workflow.connect([
666678
(inputnode, wm_mask, [('t1_seg', 'in_seg')]),
667679
(inputnode, flt_bbr, [('in_file', 'in_file'),

fmriprep/workflows/bold/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ def init_enhance_and_skullstrip_bold_wf(
290290
name='init_aff',
291291
n_procs=omp_nthreads)
292292

293-
if parseversion(Registration().version) > Version('2.2.0'):
293+
# Registration().version may be None
294+
if parseversion(Registration().version or '0.0.0') > Version('2.2.0'):
294295
init_aff.inputs.search_grid = (40, (0, 40, 40))
295296

296297
# Set up spatial normalization

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
niworkflows>=0.5.2.post5,<0.5.3
21
grabbit==0.2.3
32
pybids==0.6.5
3+
git+https://github.com/poldracklab/niworkflows.git@master#egg=niworkflows

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def main():
3838
'data/*.mat',
3939
'data/boilerplate.bib',
4040
'data/itkIdentityTransform.txt',
41+
'data/flirtsch/bbr.sch',
4142
'viz/*.tpl',
4243
'viz/*.json',
4344
]

0 commit comments

Comments
 (0)