|
57 | 57 | import smriprep
|
58 | 58 |
|
59 | 59 | from ..interfaces import DerivativesDataSink
|
| 60 | +from ..interfaces.calc import T1T2Ratio |
60 | 61 | from ..utils.misc import apply_lut as _apply_bids_lut
|
61 | 62 | from ..utils.misc import fs_isRunning as _fs_isRunning
|
62 | 63 | from .fit.registration import init_register_template_wf
|
|
83 | 84 | init_hcp_morphometrics_wf,
|
84 | 85 | init_morph_grayords_wf,
|
85 | 86 | init_msm_sulc_wf,
|
| 87 | + init_myelinmap_fsLR_wf, |
86 | 88 | init_refinement_wf,
|
87 | 89 | init_resample_surfaces_wf,
|
88 | 90 | init_surface_derivatives_wf,
|
@@ -459,6 +461,52 @@ def init_anat_preproc_wf(
|
459 | 461 | ]),
|
460 | 462 | ]) # fmt:skip
|
461 | 463 |
|
| 464 | + if t2w: |
| 465 | + myelinmap_sources = pe.Node(niu.Merge(2), name='myelinmap_sources') |
| 466 | + t1t2_ratio = pe.Node(T1T2Ratio(), name='t1t2_ratio') |
| 467 | + myelinmap_fsLR_wf = init_myelinmap_fsLR_wf( |
| 468 | + grayord_density=cifti_output, omp_nthreads=omp_nthreads, mem_gb=1 |
| 469 | + ) |
| 470 | + ds_grayord_myelinmap_wf = init_ds_grayord_metrics_wf( |
| 471 | + bids_root=bids_root, |
| 472 | + output_dir=output_dir, |
| 473 | + metrics=['myelinmap'], |
| 474 | + cifti_output=cifti_output, |
| 475 | + ) |
| 476 | + |
| 477 | + workflow.connect([ |
| 478 | + (anat_fit_wf, t1t2_ratio, [ |
| 479 | + ('outputnode.t1w_preproc', 't1w_file'), |
| 480 | + ('outputnode.t2w_preproc', 't2w_file'), |
| 481 | + ]), |
| 482 | + (t1t2_ratio, myelinmap_fsLR_wf, [('out_file', 'inputnode.in_file')]), |
| 483 | + (anat_fit_wf, myelinmap_fsLR_wf, [ |
| 484 | + ('outputnode.midthickness', 'inputnode.midthickness'), |
| 485 | + ( |
| 486 | + f"outputnode.sphere_reg_{'msm' if msm_sulc else 'fsLR'}", |
| 487 | + 'inputnode.sphere_reg_fsLR', |
| 488 | + ), |
| 489 | + ]), |
| 490 | + (hcp_morphometrics_wf, myelinmap_fsLR_wf, [ |
| 491 | + ('outputnode.thickness', 'inputnode.thickness'), |
| 492 | + ('outputnode.roi', 'inputnode.cortex_mask'), |
| 493 | + ]), |
| 494 | + (resample_surfaces_wf, myelinmap_fsLR_wf, [ |
| 495 | + ('outputnode.midthickness_fsLR', 'inputnode.midthickness_fsLR'), |
| 496 | + ]), |
| 497 | + (anat_fit_wf, myelinmap_sources, [ |
| 498 | + ('outputnode.t1w_preproc', 'in1'), |
| 499 | + ('outputnode.t2w_preproc', 'in2'), |
| 500 | + ]), |
| 501 | + (myelinmap_sources, ds_grayord_myelinmap_wf, [ |
| 502 | + ('out', 'inputnode.source_files'), |
| 503 | + ]), |
| 504 | + (myelinmap_fsLR_wf, ds_grayord_myelinmap_wf, [ |
| 505 | + ('outputnode.out_file', 'inputnode.myelinmap'), |
| 506 | + ('outputnode.out_metadata', 'inputnode.myelinmap_metadata'), |
| 507 | + ]), |
| 508 | + ]) # fmt:skip |
| 509 | + |
462 | 510 | return workflow
|
463 | 511 |
|
464 | 512 |
|
|
0 commit comments