@@ -127,6 +127,8 @@ def init_bold_reg_wf(
127
127
Affine transform from T1 space to BOLD space (ITK format)
128
128
fallback
129
129
Boolean indicating whether BBR was rejected (mri_coreg registration returned)
130
+ flip_info
131
+ Information regarding whether a left-right flip was detected
130
132
131
133
See Also
132
134
--------
@@ -153,7 +155,9 @@ def init_bold_reg_wf(
153
155
)
154
156
155
157
outputnode = pe .Node (
156
- niu .IdentityInterface (fields = ['itk_bold_to_t1' , 'itk_t1_to_bold' , 'fallback' ]),
158
+ niu .IdentityInterface (
159
+ fields = ['itk_bold_to_t1' , 'itk_t1_to_bold' , 'fallback' , 'flip_info' ]
160
+ ),
157
161
name = 'outputnode' ,
158
162
)
159
163
@@ -187,6 +191,7 @@ def init_bold_reg_wf(
187
191
('outputnode.itk_bold_to_t1' , 'itk_bold_to_t1' ),
188
192
('outputnode.itk_t1_to_bold' , 'itk_t1_to_bold' ),
189
193
('outputnode.fallback' , 'fallback' ),
194
+ ('outputnode.flip_info' , 'flip_info' ),
190
195
]),
191
196
]) # fmt:skip
192
197
@@ -267,6 +272,8 @@ def init_bbreg_wf(
267
272
Affine transform from T1 space to BOLD space (ITK format)
268
273
fallback
269
274
Boolean indicating whether BBR was rejected (mri_coreg registration returned)
275
+ flip_info
276
+ Information regarding whether a left-right flip was detected
270
277
271
278
"""
272
279
from nipype .interfaces .freesurfer import BBRegister
@@ -275,6 +282,7 @@ def init_bbreg_wf(
275
282
from niworkflows .interfaces .nitransforms import ConcatenateXFMs
276
283
277
284
from fmriprep .interfaces .patches import FreeSurferSource , MRICoreg
285
+ from fmriprep .interfaces .reports import CheckFlip
278
286
279
287
workflow = Workflow (name = name )
280
288
workflow .__desc__ = """\
@@ -309,7 +317,7 @@ def init_bbreg_wf(
309
317
name = 'inputnode' ,
310
318
)
311
319
outputnode = pe .Node (
312
- niu .IdentityInterface (['itk_bold_to_t1' , 'itk_t1_to_bold' , 'fallback' ]),
320
+ niu .IdentityInterface (['itk_bold_to_t1' , 'itk_t1_to_bold' , 'fallback' , 'flip_info' ]),
313
321
name = 'outputnode' ,
314
322
)
315
323
@@ -358,6 +366,9 @@ def init_bbreg_wf(
358
366
name = 'bbregister' ,
359
367
mem_gb = 12 ,
360
368
)
369
+
370
+ check_flip = pe .Node (CheckFlip (), name = 'check_flip' )
371
+
361
372
transforms = pe .Node (niu .Merge (2 ), run_without_submitting = True , name = 'transforms' )
362
373
# In cases where Merge(2) only has `in1` or `in2` defined
363
374
# output list will just contain a single element
@@ -411,7 +422,10 @@ def init_bbreg_wf(
411
422
('subject_id' , 'subject_id' )]),
412
423
(inputnode , lr_flip ), [('in_file' , 'in_file' )],
413
424
(lr_flip , bbregister_flipped ), [('out_file' , 'source_file' )],
425
+ (bbregister , check_flip ), [('min_cost_file' , 'cost_original' )],
426
+ (bbregister_flipped , check_flip ), [('min_cost_file' , 'cost_flipped' )],
414
427
(bbregister , transforms , [('out_lta_file' , 'in1' )]),
428
+ (check_flip , outputnode , [('flip_info' , 'flip_info' )]),
415
429
]) # fmt:skip
416
430
417
431
# Short-circuit workflow building, use boundary-based registration
0 commit comments