@@ -130,18 +130,19 @@ def init_dwi_preproc_wf(
130
130
# For doc building purposes
131
131
if not hasattr (layout , 'parse_file_entities' ):
132
132
LOGGER .log (25 , 'No valid layout: building empty workflow.' )
133
+ b0_ixs = [0 ]
133
134
metadata = {
134
135
'PhaseEncodingDirection' : 'j' ,
135
136
}
136
137
else :
137
138
metadata = layout .get_metadata (dwi_file )
138
139
139
140
inputnode = pe .Node (niu .IdentityInterface (
140
- fields = ['dwi_file' ]),
141
+ fields = ['dwi_file' , 'bvec_file' , 'bval_file' ]),
141
142
name = 'inputnode' )
142
143
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
145
146
146
147
outputnode = pe .Node (niu .IdentityInterface (
147
148
fields = ['dwi_file' , 'bvec_file' , 'bval_file' , 'rasb_file' ,
@@ -167,6 +168,12 @@ def init_dwi_preproc_wf(
167
168
('bval_file' , 'in_bval' )]),
168
169
(inputnode , dwi_reference_wf , [('dwi_file' , 'inputnode.dwi_file' )]),
169
170
(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' )])
170
177
])
171
178
172
179
# REPORTING
@@ -176,6 +183,18 @@ def init_dwi_preproc_wf(
176
183
mem_gb = DEFAULT_MEMORY_MIN_GB
177
184
)
178
185
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
+
179
198
return workflow
180
199
181
200
0 commit comments