@@ -400,6 +400,8 @@ def init_pet_fit_wf(
400
400
ds_petmask_wf .inputs .inputnode .source_files = [pet_file ]
401
401
workflow .connect ([(merge_mask , ds_petmask_wf , [('out' , 'inputnode.petmask' )])])
402
402
403
+ pvc_method = getattr (config .workflow , 'pvc_method' , None )
404
+
403
405
# Stage 4: Reference mask generation
404
406
if config .workflow .ref_mask_name :
405
407
config .loggers .workflow .info (
@@ -437,22 +439,23 @@ def init_pet_fit_wf(
437
439
)
438
440
pet_ref_tacs_wf .inputs .inputnode .ref_mask_name = config .workflow .ref_mask_name
439
441
440
- ds_ref_tacs = pe .Node (
441
- DerivativesDataSink (
442
- base_directory = config .execution .petprep_dir ,
443
- suffix = 'tacs' ,
444
- seg = config .workflow .seg ,
445
- desc = 'preproc' ,
446
- ref = config .workflow .ref_mask_name ,
447
- allowed_entities = ('seg' , 'ref' ),
448
- TaskName = metadata .get ('TaskName' ),
449
- ** timing_parameters ,
450
- ),
451
- name = 'ds_ref_tacs' ,
452
- run_without_submitting = True ,
453
- mem_gb = config .DEFAULT_MEMORY_MIN_GB ,
454
- )
455
- ds_ref_tacs .inputs .source_file = pet_file
442
+ if pvc_method is None :
443
+ ds_ref_tacs = pe .Node (
444
+ DerivativesDataSink (
445
+ base_directory = config .execution .petprep_dir ,
446
+ suffix = 'tacs' ,
447
+ seg = config .workflow .seg ,
448
+ desc = 'preproc' ,
449
+ ref = config .workflow .ref_mask_name ,
450
+ allowed_entities = ('seg' , 'ref' ),
451
+ TaskName = metadata .get ('TaskName' ),
452
+ ** timing_parameters ,
453
+ ),
454
+ name = 'ds_ref_tacs' ,
455
+ run_without_submitting = True ,
456
+ mem_gb = config .DEFAULT_MEMORY_MIN_GB ,
457
+ )
458
+ ds_ref_tacs .inputs .source_file = pet_file
456
459
457
460
workflow .connect ([(inputnode , gm_select , [('t1w_tpms' , 'inlist' )])])
458
461
@@ -534,15 +537,20 @@ def init_pet_fit_wf(
534
537
('outputnode.refmask_file' , 'inputnode.mask_file' ),
535
538
],
536
539
),
537
- (
538
- pet_ref_tacs_wf ,
539
- ds_ref_tacs ,
540
- [
541
- ('outputnode.timeseries' , 'in_file' ),
542
- ],
543
- ),
544
540
]
545
541
)
542
+ if pvc_method is None :
543
+ workflow .connect (
544
+ [
545
+ (
546
+ pet_ref_tacs_wf ,
547
+ ds_ref_tacs ,
548
+ [
549
+ ('outputnode.timeseries' , 'in_file' ),
550
+ ],
551
+ ),
552
+ ]
553
+ )
546
554
else :
547
555
config .loggers .workflow .info ('PET Stage 4: Reference mask generation skipped' )
548
556
0 commit comments