@@ -556,22 +556,11 @@ def init_single_subject_wf(subject_id: str):
556
556
filters = config .execution .get ().get ('bids_filters' , {}).get ('fmap' ),
557
557
)
558
558
559
- fmap_merge_nodes = {
559
+ fmap_buffers = {
560
560
field : pe .Node (niu .Merge (2 ), name = f'{ field } _merge' , run_without_submitting = True )
561
561
for field in ['fmap' , 'fmap_ref' , 'fmap_coeff' , 'fmap_mask' , 'fmap_id' , 'sdc_method' ]
562
562
}
563
563
564
- fmap_buffer = pe .Node (
565
- niu .IdentityInterface (
566
- fields = ['fmap' , 'fmap_ref' , 'fmap_coeff' , 'fmap_mask' , 'fmap_id' , 'sdc_method' ]
567
- ),
568
- name = 'fmap_buffer' ,
569
- )
570
-
571
- workflow .connect (
572
- [(fmap_merge_nodes [field ], fmap_buffer , [('out' , field )]) for field in fmap_merge_nodes ]
573
- )
574
-
575
564
missing_estimators = []
576
565
if fmap_estimators :
577
566
# Map fmapid entity to internal bids_id
@@ -588,23 +577,23 @@ def init_single_subject_wf(subject_id: str):
588
577
f'{ len (pared_cache )} estimator(s): { list (pared_cache )} .'
589
578
)
590
579
591
- fmap_merge_nodes ['fmap' ].inputs .in1 = [
580
+ fmap_buffers ['fmap' ].inputs .in1 = [
592
581
pared_cache [fmapid ]['fieldmap' ] for fmapid in pared_cache
593
582
]
594
- fmap_merge_nodes ['fmap_ref' ].inputs .in1 = [
583
+ fmap_buffers ['fmap_ref' ].inputs .in1 = [
595
584
pared_cache [fmapid ]['magnitude' ] for fmapid in pared_cache
596
585
]
597
- fmap_merge_nodes ['fmap_coeff' ].inputs .in1 = [
586
+ fmap_buffers ['fmap_coeff' ].inputs .in1 = [
598
587
pared_cache [fmapid ]['coeffs' ] for fmapid in pared_cache
599
588
]
600
589
# Note that masks are not emitted. The BOLD-fmap transforms cannot be
601
590
# computed with precomputed fieldmaps until we either start emitting masks
602
591
# or start skull-stripping references on the fly.
603
- fmap_merge_nodes ['fmap_mask' ].inputs .in1 = [
592
+ fmap_buffers ['fmap_mask' ].inputs .in1 = [
604
593
pared_cache [fmapid ].get ('mask' , 'MISSING' ) for fmapid in pared_cache
605
594
]
606
- fmap_merge_nodes ['fmap_id' ].inputs .in1 = list (pared_cache )
607
- fmap_merge_nodes ['sdc_method' ].inputs .in1 = ['precomputed' ] * len (pared_cache )
595
+ fmap_buffers ['fmap_id' ].inputs .in1 = list (pared_cache )
596
+ fmap_buffers ['sdc_method' ].inputs .in1 = ['precomputed' ] * len (pared_cache )
608
597
609
598
if missing_estimators :
610
599
config .loggers .workflow .info (
@@ -637,12 +626,12 @@ def init_single_subject_wf(subject_id: str):
637
626
fmap_wf .get_node (node ).interface .out_path_base = ''
638
627
639
628
workflow .connect ([
640
- (fmap_wf , fmap_merge_nodes [field ], [
629
+ (fmap_wf , fmap_buffers [field ], [
641
630
# We get "sdc_method" as "method" from estimator workflows
642
631
# All else stays the same, and no other sdc_ prefixes are used
643
632
(f'outputnode.{ field .removeprefix ("sdc_" )} ' , 'in2' ),
644
633
])
645
- for field in fmap_merge_nodes
634
+ for field in fmap_buffers
646
635
]) # fmt:skip
647
636
648
637
fmap_select_std = pe .Node (
@@ -785,10 +774,11 @@ def init_single_subject_wf(subject_id: str):
785
774
'inputnode.sphere_reg_fsLR' ,
786
775
),
787
776
]),
788
- (fmap_buffer , bold_wf , [
789
- (field , f'inputnode.{ field } ' )
790
- for field in fmap_merge_nodes
791
- ]),
777
+ ]) # fmt:skip
778
+
779
+ workflow .connect ([
780
+ (buffer , bold_wf , [('out' , f'inputnode.{ field } ' )])
781
+ for field , buffer in fmap_buffers .items ()
792
782
]) # fmt:skip
793
783
794
784
if config .workflow .level == 'full' :
0 commit comments