|
12 | 12 | from niworkflows.utils.misc import fix_multi_T1w_source_name
|
13 | 13 | from niworkflows.utils.spaces import Reference
|
14 | 14 | from smriprep.workflows.anatomical import init_anat_preproc_wf
|
| 15 | +from fmriprep.workflows.bold.registration import init_bbreg_wf |
15 | 16 |
|
16 | 17 | from ..interfaces import DerivativesDataSink, BIDSDataGrabber
|
17 | 18 | from ..interfaces.reports import SubjectSummary, AboutSummary
|
18 | 19 | from ..utils.bids import collect_data
|
19 | 20 | from .dwi.base import init_early_b0ref_wf
|
20 | 21 | from .fmap.base import init_fmap_estimation_wf
|
21 |
| -from .dwi.registration import init_bbreg_wf |
| 22 | + |
22 | 23 |
|
23 | 24 | def init_dmriprep_wf():
|
24 | 25 | """
|
@@ -287,7 +288,7 @@ def init_single_subject_wf(subject_id):
|
287 | 288 | return workflow
|
288 | 289 |
|
289 | 290 | # Append the dMRI section to the existing anatomical excerpt
|
290 |
| - # That way we do not need to stream down the number of bold datasets |
| 291 | + # That way we do not need to stream down the number of DWI datasets |
291 | 292 | anat_preproc_wf.__postdesc__ = (
|
292 | 293 | (anat_preproc_wf.__postdesc__ or "")
|
293 | 294 | + f"""
|
@@ -358,28 +359,42 @@ def init_single_subject_wf(subject_id):
|
358 | 359 | from niworkflows.interfaces.nibabel import ApplyMask
|
359 | 360 |
|
360 | 361 | # Mask the T1w
|
361 |
| - t1w_brain = pe.Node(ApplyMask(), name='t1w_brain') |
| 362 | + t1w_brain = pe.Node(ApplyMask(), name="t1w_brain") |
362 | 363 |
|
363 | 364 | bbr_wf = init_bbreg_wf(
|
364 |
| - bold2t1w_init=config.workflow.bold2t1w_init, |
| 365 | + bold2t1w_init=config.workflow.dwi2t1w_init, |
365 | 366 | omp_nthreads=config.nipype.omp_nthreads,
|
366 | 367 | use_bbr=True,
|
367 | 368 | )
|
368 | 369 |
|
369 |
| - workflow.connect([ |
370 |
| - # T1w Mask |
371 |
| - (anat_preproc_wf, t1w_brain, [('outputnode.t1w_preproc', 'in_file'), |
372 |
| - ('outputnode.t1w_mask', 'in_mask')]), |
373 |
| - # BBRegister |
374 |
| - (split_info, bbr_wf, [('dwi_file', 'inputnode.in_file')]), |
375 |
| - (t1w_brain, bbr_wf, [('out_file', 'inputnode.t1w_brain')]), |
376 |
| - (anat_preproc_wf, bbr_wf, [('outputnode.t1w_dseg', 'inputnode.t1w_dseg')]), |
377 |
| - (fsinputnode, bbr_wf, [("subjects_dir", "inputnode.subjects_dir")]), |
378 |
| - (bids_info, bbr_wf, [('subject', 'inputnode.subject_id')]), |
379 |
| - (anat_preproc_wf, bbr_wf, [ |
380 |
| - ('outputnode.fsnative2t1w_xfm', 'inputnode.fsnative2t1w_xfm') |
381 |
| - ]) |
382 |
| - ]) |
| 370 | + workflow.connect( |
| 371 | + [ |
| 372 | + # T1w Mask |
| 373 | + ( |
| 374 | + anat_preproc_wf, |
| 375 | + t1w_brain, |
| 376 | + [ |
| 377 | + ("outputnode.t1w_preproc", "in_file"), |
| 378 | + ("outputnode.t1w_mask", "in_mask"), |
| 379 | + ], |
| 380 | + ), |
| 381 | + # BBRegister |
| 382 | + (split_info, bbr_wf, [("dwi_file", "inputnode.in_file")]), |
| 383 | + (t1w_brain, bbr_wf, [("out_file", "inputnode.t1w_brain")]), |
| 384 | + ( |
| 385 | + anat_preproc_wf, |
| 386 | + bbr_wf, |
| 387 | + [("outputnode.t1w_dseg", "inputnode.t1w_dseg")], |
| 388 | + ), |
| 389 | + (fsinputnode, bbr_wf, [("subjects_dir", "inputnode.subjects_dir")]), |
| 390 | + (bids_info, bbr_wf, [("subject", "inputnode.subject_id")]), |
| 391 | + ( |
| 392 | + anat_preproc_wf, |
| 393 | + bbr_wf, |
| 394 | + [("outputnode.fsnative2t1w_xfm", "inputnode.fsnative2t1w_xfm")], |
| 395 | + ), |
| 396 | + ] |
| 397 | + ) |
383 | 398 |
|
384 | 399 | fmap_estimation_wf = init_fmap_estimation_wf(
|
385 | 400 | subject_data["dwi"], debug=config.execution.debug
|
|
0 commit comments