Skip to content

Commit a6ca8af

Browse files
authored
Merge pull request #102 from oesteban/enh/new-datasinks
ENH: Use new ``DerivativesDataSink`` from NiWorkflows 1.2.0
2 parents 5878bc3 + 2ff4790 commit a6ca8af

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ git+https://github.com/rwblair/sphinxcontrib-versioning.git@39b40b0b84bf872fc398
33
nbsphinx
44
niflow-nipype1-workflows ~= 0.0.1
55
nipype>=1.3.1
6-
niworkflows >=1.2.0rc4,<1.4
6+
git+https://github.com/nipreps/niworkflows.git@master
77
packaging
88
pydot>=1.2.3
99
pydotplus

sdcflows/workflows/fmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def init_fmap2field_wf(omp_nthreads, debug, name='fmap2field_wf',
242242
reference_label='EPI Reference',
243243
moving_label='Magnitude', show='both'), name='fmap_rpt')
244244
ds_report_sdc = pe.Node(
245-
DerivativesDataSink(desc='fieldmap', suffix='bold'),
245+
DerivativesDataSink(desc='fieldmap', suffix='bold', datatype='figures'),
246246
name='ds_report_fmap', mem_gb=0.01, run_without_submitting=True
247247
)
248248

sdcflows/workflows/outputs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def init_sdc_unwarp_report_wf(name='sdc_unwarp_report_wf', forcedsyn=False):
6363
bold_rpt = pe.Node(SimpleBeforeAfter(), name='bold_rpt',
6464
mem_gb=0.1)
6565
ds_report_sdc = pe.Node(
66-
DerivativesDataSink(desc='sdc' if not forcedsyn else 'forcedsyn',
67-
suffix='bold'), name='ds_report_sdc',
66+
DerivativesDataSink(desc=('sdc', 'forcedsyn')[forcedsyn], suffix='bold',
67+
datatype='figures'), name='ds_report_sdc',
6868
mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True
6969
)
7070

sdcflows/workflows/tests/test_pepolar.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,8 @@ def test_pepolar_wf1(bids_layouts, output_path, dataset, workdir):
160160
rep = pe.Node(FieldmapReportlet(reference_label='EPI Reference'), 'simple_report')
161161
rep.interface._always_run = True
162162
dsink = pe.Node(DerivativesDataSink(
163-
base_directory=str(output_path), keep_dtype=True,
164-
desc='pepolar'), name='dsink')
165-
dsink.interface.out_path_base = 'sdcflows'
163+
base_directory=str(output_path), out_path_base='sdcflows', datatype="figures",
164+
suffix='fieldmap', desc='pepolar', dismiss_entities='fmap'), name='dsink')
166165
dsink.inputs.source_file = epidata[0].path
167166

168167
boiler.connect([

sdcflows/workflows/tests/test_phdiff.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ def test_phdiff(bids_layouts, tmpdir, output_path, dataset, workdir):
4040
rep = pe.Node(FieldmapReportlet(reference_label='Magnitude'), 'simple_report')
4141
rep.interface._always_run = True
4242

43-
dsink = pe.Node(DerivativesDataSink(
44-
base_directory=str(output_path), keep_dtype=True), name='dsink')
45-
dsink.interface.out_path_base = 'sdcflows'
46-
dsink.inputs.source_file = phdiff_files[0].path
43+
ds_report = pe.Node(DerivativesDataSink(
44+
base_directory=str(output_path), out_path_base='sdcflows', datatype='figures',
45+
suffix='fieldmap', desc='phasediff', dismiss_entities='fmap'), name='ds_report')
46+
ds_report.inputs.source_file = phdiff_files[0].path
4747

4848
dsink_fmap = pe.Node(DerivativesDataSink(
49-
base_directory=str(output_path), keep_dtype=True), name='dsink_fmap')
49+
base_directory=str(output_path), dismiss_entities='fmap',
50+
desc='phasediff', suffix='fieldmap'), name='dsink_fmap')
5051
dsink_fmap.interface.out_path_base = 'sdcflows'
5152
dsink_fmap.inputs.source_file = phdiff_files[0].path
5253

@@ -55,7 +56,7 @@ def test_phdiff(bids_layouts, tmpdir, output_path, dataset, workdir):
5556
('outputnode.fmap', 'fieldmap'),
5657
('outputnode.fmap_ref', 'reference'),
5758
('outputnode.fmap_mask', 'mask')]),
58-
(rep, dsink, [('out_report', 'in_file')]),
59+
(rep, ds_report, [('out_report', 'in_file')]),
5960
(phdiff_wf, dsink_fmap, [('outputnode.fmap', 'in_file')]),
6061
])
6162
else:
@@ -91,13 +92,14 @@ def test_phases(bids_layouts, tmpdir, output_path, workdir):
9192
rep = pe.Node(FieldmapReportlet(reference_label='Magnitude'), 'simple_report')
9293
rep.interface._always_run = True
9394

94-
dsink = pe.Node(DerivativesDataSink(
95-
base_directory=str(output_path), keep_dtype=True), name='dsink')
96-
dsink.interface.out_path_base = 'sdcflows'
97-
dsink.inputs.source_file = phdiff_files[0].path
95+
ds_report = pe.Node(DerivativesDataSink(
96+
base_directory=str(output_path), out_path_base='sdcflows', datatype='figures',
97+
suffix='fieldmap', desc='twophases', dismiss_entities='fmap'), name='ds_report')
98+
ds_report.inputs.source_file = phdiff_files[0].path
9899

99100
dsink_fmap = pe.Node(DerivativesDataSink(
100-
base_directory=str(output_path), keep_dtype=True), name='dsink_fmap')
101+
base_directory=str(output_path), suffix='fieldmap', desc='twophases',
102+
dismiss_entities='fmap'), name='dsink_fmap')
101103
dsink_fmap.interface.out_path_base = 'sdcflows'
102104
dsink_fmap.inputs.source_file = phdiff_files[0].path
103105

@@ -106,7 +108,7 @@ def test_phases(bids_layouts, tmpdir, output_path, workdir):
106108
('outputnode.fmap', 'fieldmap'),
107109
('outputnode.fmap_ref', 'reference'),
108110
('outputnode.fmap_mask', 'mask')]),
109-
(rep, dsink, [('out_report', 'in_file')]),
111+
(rep, ds_report, [('out_report', 'in_file')]),
110112
(phdiff_wf, dsink_fmap, [('outputnode.fmap', 'in_file')]),
111113
])
112114
else:

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ install_requires =
2929
nibabel >=3.0.1
3030
niflow-nipype1-workflows ~= 0.0.1
3131
nipype >=1.3.1,<2.0
32-
niworkflows >=1.2.0rc4,<1.4
32+
niworkflows @ git+https://github.com/nipreps/niworkflows.git@master
3333
numpy
34-
pybids >= 0.9.2
34+
pybids >= 0.10.2
3535
templateflow >=0.4
3636
test_requires =
3737
codecov

0 commit comments

Comments
 (0)