@@ -511,16 +511,21 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
511
511
)
512
512
bold_confounds_wf .get_node ("inputnode" ).inputs .t1_transform_flags = [False ]
513
513
514
- # Detect dummy scans
515
- nss_detector = pe .Node (NonsteadyStatesDetector (), name = 'nss_detector' )
516
- nss_detector .inputs .in_file = ref_file
514
+ dummy_buffer = pe .Node (niu .IdentityInterface (fields = ['n_dummy' ]), name = 'dummy_buffer' )
515
+ if (dummy := config .workflow .dummy_scans ) is not None :
516
+ dummy_buffer .inputs .n_dummy = dummy
517
+ else :
518
+ # Detect dummy scans
519
+ nss_detector = pe .Node (NonsteadyStatesDetector (), name = 'nss_detector' )
520
+ nss_detector .inputs .in_file = ref_file
521
+ workflow .connect (nss_detector , 'n_dummy' , dummy_buffer , 'n_dummy' )
517
522
518
523
# SLICE-TIME CORRECTION (or bypass) #############################################
519
524
if run_stc :
520
525
bold_stc_wf = init_bold_stc_wf (name = "bold_stc_wf" , metadata = metadata )
521
526
# fmt:off
522
527
workflow .connect ([
523
- (nss_detector , bold_stc_wf , [('n_dummy' , 'inputnode.skip_vols' )]),
528
+ (dummy_buffer , bold_stc_wf , [('n_dummy' , 'inputnode.skip_vols' )]),
524
529
(select_bold , bold_stc_wf , [("out" , 'inputnode.bold_file' )]),
525
530
(bold_stc_wf , boldbuffer , [('outputnode.stc_file' , 'bold_file' )]),
526
531
])
@@ -663,7 +668,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
663
668
('outputnode.rmsd_file' , 'inputnode.rmsd_file' )]),
664
669
(bold_reg_wf , bold_confounds_wf , [
665
670
('outputnode.itk_t1_to_bold' , 'inputnode.t1_bold_xform' )]),
666
- (nss_detector , bold_confounds_wf , [
671
+ (dummy_buffer , bold_confounds_wf , [
667
672
('n_dummy' , 'inputnode.skip_vols' )]),
668
673
(bold_final , bold_confounds_wf , [
669
674
('bold' , 'inputnode.bold' ),
@@ -676,7 +681,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
676
681
('outputnode.tcompcor_mask' , 'tcompcor_mask' ),
677
682
]),
678
683
# Summary
679
- (nss_detector , summary , [('n_dummy' , 'algo_dummy_scans' )]),
684
+ (dummy_buffer , summary , [('n_dummy' , 'algo_dummy_scans' )]),
680
685
(bold_reg_wf , summary , [('outputnode.fallback' , 'fallback' )]),
681
686
(outputnode , summary , [('confounds' , 'confounds_file' )]),
682
687
# Select echo indices for original/validated BOLD files
@@ -878,7 +883,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
878
883
('bold_file' , 'inputnode.name_source' )]),
879
884
(bold_hmc_wf , ica_aroma_wf , [
880
885
('outputnode.movpar_file' , 'inputnode.movpar_file' )]),
881
- (nss_detector , ica_aroma_wf , [
886
+ (dummy_buffer , ica_aroma_wf , [
882
887
('n_dummy' , 'inputnode.skip_vols' )]),
883
888
(bold_confounds_wf , join , [
884
889
('outputnode.confounds_file' , 'in_file' )]),
0 commit comments