Skip to content

Commit bee7b66

Browse files
committed
[MAINT] Update code to pybids>=0.7 and niworkflows
1 parent effe0a2 commit bee7b66

File tree

6 files changed

+28
-14
lines changed

6 files changed

+28
-14
lines changed

fmriprep/__about__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@
8484
]
8585

8686
REQUIRES = [
87-
'grabbit==0.2.3',
87+
'grabbit==0.2.6',
8888
'indexed_gzip>=0.8.8',
8989
'nibabel>=2.2.1',
9090
'nilearn',
9191
'nipype>=1.1.6',
9292
'nitime',
93-
'niworkflows>=0.6.1,<0.7.0a0',
93+
'niworkflows>=0.6.1',
9494
'numpy',
9595
'pandas',
9696
'psutil>=5.4',
97-
'pybids==0.6.5',
97+
'pybids>=0.7.0,<8',
9898
'pyyaml',
9999
'scikit-image',
100100
'smriprep>=0.0.4,<0.1.0a0',
@@ -105,6 +105,8 @@
105105

106106

107107
LINKS_REQUIRES = [
108+
'git+https://github.com/oesteban/niworkflows@'
109+
'e3b6647c4dd9b29e459bd99e7a91548cf016ce3f#niworkflows-0.6.1',
108110
]
109111

110112
TESTS_REQUIRES = [

fmriprep/cli/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,8 @@ def build_workflow(opts, retval):
607607
# First check that bids_dir looks like a BIDS folder
608608
bids_dir = os.path.abspath(opts.bids_dir)
609609
subject_list = collect_participants(
610-
bids_dir, participant_label=opts.participant_label)
610+
bids_dir, participant_label=opts.participant_label,
611+
bids_validate=False)
611612

612613
# Load base plugin_settings from file if --use-plugin
613614
if opts.use_plugin is not None:

fmriprep/workflows/base.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ def init_single_subject_wf(subject_id, task_id, echo_idx, name, reportlets_dir,
379379
}
380380
layout = None
381381
else:
382-
subject_data, layout = collect_data(bids_dir, subject_id, task_id, echo_idx)
382+
subject_data, layout = collect_data(
383+
bids_dir, subject_id, task_id, echo_idx, bids_validate=False)
383384

384385
# Make sure we always go through these two checks
385386
if not anat_only and subject_data['bold'] == []:
@@ -421,7 +422,9 @@ def init_single_subject_wf(subject_id, task_id, echo_idx, name, reportlets_dir,
421422
bidssrc = pe.Node(BIDSDataGrabber(subject_data=subject_data, anat_only=anat_only),
422423
name='bidssrc')
423424

424-
bids_info = pe.Node(BIDSInfo(), name='bids_info', run_without_submitting=True)
425+
bids_info = pe.Node(BIDSInfo(
426+
bids_dir=bids_dir, bids_validate=False),
427+
name='bids_info', run_without_submitting=True)
425428

426429
summary = pe.Node(SubjectSummary(output_spaces=output_spaces, template=template),
427430
name='summary', run_without_submitting=True)
@@ -464,12 +467,12 @@ def init_single_subject_wf(subject_id, task_id, echo_idx, name, reportlets_dir,
464467
(bidssrc, summary, [('t1w', 't1w'),
465468
('t2w', 't2w'),
466469
('bold', 'bold')]),
467-
(bids_info, summary, [('subject_id', 'subject_id')]),
470+
(bids_info, summary, [('subject', 'subject_id')]),
471+
(bids_info, anat_preproc_wf, [(('subject', _prefix), 'inputnode.subject_id')]),
468472
(bidssrc, anat_preproc_wf, [('t1w', 'inputnode.t1w'),
469473
('t2w', 'inputnode.t2w'),
470474
('roi', 'inputnode.roi'),
471475
('flair', 'inputnode.flair')]),
472-
(summary, anat_preproc_wf, [('subject_id', 'inputnode.subject_id')]),
473476
(bidssrc, ds_report_summary, [(('t1w', fix_multi_T1w_source_name), 'source_file')]),
474477
(summary, ds_report_summary, [('out_report', 'in_file')]),
475478
(bidssrc, ds_report_about, [(('t1w', fix_multi_T1w_source_name), 'source_file')]),
@@ -532,3 +535,10 @@ def init_single_subject_wf(subject_id, task_id, echo_idx, name, reportlets_dir,
532535
])
533536

534537
return workflow
538+
539+
540+
def _prefix(subid):
541+
if subid.startswith('sub-'):
542+
return subid
543+
return '-'.join(('sub', subid))
544+

fmriprep/workflows/bold/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
264264
else:
265265
# Find associated sbref, if possible
266266
entities = layout.parse_file_entities(ref_file)
267-
entities['type'] = 'sbref'
268-
files = layout.get(**entities, extensions=['nii', 'nii.gz'])
267+
entities['suffix'] = 'sbref'
268+
files = layout.get(extensions=['nii', 'nii.gz'], **entities)
269269
refbase = os.path.basename(ref_file)
270270
if 'sbref' in ignore:
271271
LOGGER.info("Single-band reference files ignored.")

fmriprep/workflows/fieldmap/phdiff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def _pick1st(inlist):
7373
return inlist[0]
7474

7575
# Read phasediff echo times
76-
meta = pe.Node(ReadSidecarJSON(), name='meta', mem_gb=0.01, run_without_submitting=True)
76+
meta = pe.Node(ReadSidecarJSON(bids_validate=False),
77+
name='meta', mem_gb=0.01, run_without_submitting=True)
7778

7879
# Merge input magnitude images
7980
magmrg = pe.Node(IntraModalMerge(), name='magmrg')

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
grabbit==0.2.3
2-
pybids==0.6.5
3-
niworkflows>=0.6.1,<0.7.0a0
1+
grabbit==0.2.6
2+
pybids>=0.7.0,<0.8
3+
git+https://github.com/oesteban/niworkflows@e3b6647c4dd9b29e459bd99e7a91548cf016ce3f#niworkflows-0.6.1
44
smriprep>=0.0.4,<0.1.0a0
55
templateflow>=0.0.4

0 commit comments

Comments
 (0)