|
1 | | -# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- |
2 | | -# vi: set ft=python sts=4 ts=4 sw=4 et: |
3 | | -""" |
4 | | -dMRIPrep base processing workflows. |
5 | | -
|
6 | | -.. autofunction:: init_dmriprep_wf |
7 | | -.. autofunction:: init_single_subject_wf |
8 | | -
|
9 | | -""" |
10 | | - |
| 1 | +"""dMRIPrep base processing workflows.""" |
11 | 2 | import sys |
12 | 3 | import os |
13 | 4 | from packaging.version import Version |
|
29 | 20 | from ..interfaces.reports import SubjectSummary, AboutSummary |
30 | 21 | from ..utils.bids import collect_data |
31 | 22 | from ..__about__ import __version__ |
32 | | -# from .dwi import init_dwi_preproc_wf |
| 23 | +from .dwi import init_dwi_preproc_wf |
33 | 24 |
|
34 | 25 |
|
35 | 26 | def init_dmriprep_wf( |
@@ -435,59 +426,42 @@ def init_single_subject_wf( |
435 | 426 | if anat_only: |
436 | 427 | return workflow |
437 | 428 |
|
438 | | - # for dwi_file in subject_data['dwi']: |
439 | | - # dwi_preproc_wf = init_dwi_preproc_wf( |
440 | | - # aroma_melodic_dim=aroma_melodic_dim, |
441 | | - # bold2t1w_dof=bold2t1w_dof, |
442 | | - # bold_file=bold_file, |
443 | | - # cifti_output=cifti_output, |
444 | | - # debug=debug, |
445 | | - # dummy_scans=dummy_scans, |
446 | | - # err_on_aroma_warn=err_on_aroma_warn, |
447 | | - # fmap_bspline=fmap_bspline, |
448 | | - # fmap_demean=fmap_demean, |
449 | | - # force_syn=force_syn, |
450 | | - # freesurfer=freesurfer, |
451 | | - # ignore=ignore, |
452 | | - # layout=layout, |
453 | | - # low_mem=low_mem, |
454 | | - # medial_surface_nan=medial_surface_nan, |
455 | | - # num_bold=len(subject_data['bold']), |
456 | | - # omp_nthreads=omp_nthreads, |
457 | | - # output_dir=output_dir, |
458 | | - # output_spaces=output_spaces, |
459 | | - # reportlets_dir=reportlets_dir, |
460 | | - # regressors_all_comps=regressors_all_comps, |
461 | | - # regressors_fd_th=regressors_fd_th, |
462 | | - # regressors_dvars_th=regressors_dvars_th, |
463 | | - # t2s_coreg=t2s_coreg, |
464 | | - # use_aroma=use_aroma, |
465 | | - # use_syn=use_syn, |
466 | | - # ) |
467 | | - |
468 | | - # workflow.connect([ |
469 | | - # (anat_preproc_wf, dwi_preproc_wf, |
470 | | - # [(('outputnode.t1_preproc', _pop), 'inputnode.t1_preproc'), |
471 | | - # ('outputnode.t1_brain', 'inputnode.t1_brain'), |
472 | | - # ('outputnode.t1_mask', 'inputnode.t1_mask'), |
473 | | - # ('outputnode.t1_seg', 'inputnode.t1_seg'), |
474 | | - # ('outputnode.t1_aseg', 'inputnode.t1_aseg'), |
475 | | - # ('outputnode.t1_aparc', 'inputnode.t1_aparc'), |
476 | | - # ('outputnode.t1_tpms', 'inputnode.t1_tpms'), |
477 | | - # ('outputnode.template', 'inputnode.template'), |
478 | | - # ('outputnode.forward_transform', 'inputnode.anat2std_xfm'), |
479 | | - # ('outputnode.reverse_transform', 'inputnode.std2anat_xfm'), |
480 | | - # ('outputnode.joint_template', 'inputnode.joint_template'), |
481 | | - # ('outputnode.joint_forward_transform', 'inputnode.joint_anat2std_xfm'), |
482 | | - # ('outputnode.joint_reverse_transform', 'inputnode.joint_std2anat_xfm'), |
483 | | - # # Undefined if --no-freesurfer, but this is safe |
484 | | - # ('outputnode.subjects_dir', 'inputnode.subjects_dir'), |
485 | | - # ('outputnode.subject_id', 'inputnode.subject_id'), |
486 | | - # ('outputnode.t1_2_fsnative_forward_transform', |
487 | | - # 'inputnode.t1_2_fsnative_forward_transform'), |
488 | | - # ('outputnode.t1_2_fsnative_reverse_transform', |
489 | | - # 'inputnode.t1_2_fsnative_reverse_transform')]), |
490 | | - # ]) |
| 429 | + for dwi_file in subject_data['dwi']: |
| 430 | + dwi_preproc_wf = init_dwi_preproc_wf( |
| 431 | + dwi_file=dwi_file, |
| 432 | + debug=debug, |
| 433 | + force_syn=force_syn, |
| 434 | + ignore=ignore, |
| 435 | + layout=layout, |
| 436 | + low_mem=low_mem, |
| 437 | + num_dwi=len(subject_data['dwi']), |
| 438 | + omp_nthreads=omp_nthreads, |
| 439 | + output_dir=output_dir, |
| 440 | + reportlets_dir=reportlets_dir, |
| 441 | + use_syn=use_syn, |
| 442 | + ) |
| 443 | + |
| 444 | + workflow.connect([ |
| 445 | + (anat_preproc_wf, dwi_preproc_wf, |
| 446 | + [(('outputnode.t1w_preproc', _pop), 'inputnode.t1w_preproc'), |
| 447 | + ('outputnode.t1w_brain', 'inputnode.t1w_brain'), |
| 448 | + ('outputnode.t1w_mask', 'inputnode.t1w_mask'), |
| 449 | + ('outputnode.t1w_dseg', 'inputnode.t1w_dseg'), |
| 450 | + ('outputnode.t1w_aseg', 'inputnode.t1w_aseg'), |
| 451 | + ('outputnode.t1w_aparc', 'inputnode.t1w_aparc'), |
| 452 | + ('outputnode.t1w_tpms', 'inputnode.t1w_tpms'), |
| 453 | + ('outputnode.template', 'inputnode.template'), |
| 454 | + ('outputnode.anat2std_xfm', 'inputnode.anat2std_xfm'), |
| 455 | + ('outputnode.std2anat_xfm', 'inputnode.std2anat_xfm'), |
| 456 | + ('outputnode.joint_template', 'inputnode.joint_template'), |
| 457 | + ('outputnode.joint_anat2std_xfm', 'inputnode.joint_anat2std_xfm'), |
| 458 | + ('outputnode.joint_std2anat_xfm', 'inputnode.joint_std2anat_xfm'), |
| 459 | + # Undefined if --fs-no-reconall, but this is safe |
| 460 | + ('outputnode.subjects_dir', 'inputnode.subjects_dir'), |
| 461 | + ('outputnode.subject_id', 'inputnode.subject_id'), |
| 462 | + ('outputnode.t1w2fsnative_xfm', 'inputnode.t1w2fsnative_xfm'), |
| 463 | + ('outputnode.fsnative2t1w_xfm', 'inputnode.fsnative2t1w_xfm')]), |
| 464 | + ]) |
491 | 465 |
|
492 | 466 | return workflow |
493 | 467 |
|
|
0 commit comments