Skip to content

Commit aef46db

Browse files
josephmjeoesteban
authored andcommitted
add summary and validation datasinks
1 parent 1cdadd0 commit aef46db

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

dmriprep/workflows/dwi/base.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,19 @@ def init_dwi_preproc_wf(
130130
# For doc building purposes
131131
if not hasattr(layout, 'parse_file_entities'):
132132
LOGGER.log(25, 'No valid layout: building empty workflow.')
133+
b0_ixs = [0]
133134
metadata = {
134135
'PhaseEncodingDirection': 'j',
135136
}
136137
else:
137138
metadata = layout.get_metadata(dwi_file)
138139

139140
inputnode = pe.Node(niu.IdentityInterface(
140-
fields=['dwi_file']),
141+
fields=['dwi_file', 'bvec_file', 'bval_file']),
141142
name='inputnode')
142143
inputnode.inputs.dwi_file = dwi_file
143-
inputnode.inputs.bvec_file = layout.get_bvec(dwi_file)
144-
inputnode.inputs.bval_file = layout.get_bval(dwi_file)
144+
inputnode.inputs.bvec_file = bvec_file
145+
inputnode.inputs.bval_file = bval_file
145146

146147
outputnode = pe.Node(niu.IdentityInterface(
147148
fields=['dwi_file', 'bvec_file', 'bval_file', 'rasb_file',
@@ -167,6 +168,12 @@ def init_dwi_preproc_wf(
167168
('bval_file', 'in_bval')]),
168169
(inputnode, dwi_reference_wf, [('dwi_file', 'inputnode.dwi_file')]),
169170
(gradient_table, dwi_reference_wf, [('b0_ixs', 'inputnode.b0_ixs')]),
171+
(dwi_reference_wf, outputnode, [
172+
('outputnode.dwi_file', 'dwi_file'),
173+
('outputnode.dwi_mask', 'dwi_mask')]),
174+
(gradient_table, outputnode, [
175+
('bvec_file', 'bvec_file'),
176+
('bval_file', 'bval_file')])
170177
])
171178

172179
# REPORTING
@@ -176,6 +183,18 @@ def init_dwi_preproc_wf(
176183
mem_gb=DEFAULT_MEMORY_MIN_GB
177184
)
178185

186+
ds_report_validation = pe.Node(
187+
DerivativesDataSink(base_directory=reportlets_dir,
188+
desc='validation', keep_dtype=True),
189+
name='ds_report_validation', run_without_submitting=True,
190+
mem_gb=DEFAULT_MEMORY_MIN_GB)
191+
192+
workflow.connect([
193+
(summary, ds_report_summary, [('out_report', 'in_file')]),
194+
(dwi_reference_wf, ds_report_validation, [
195+
('outputnode.validation_report', 'in_file')]),
196+
])
197+
179198
return workflow
180199

181200

0 commit comments

Comments
 (0)