@@ -324,7 +324,8 @@ def init_ds_mask_wf(
324
324
* ,
325
325
bids_root : str ,
326
326
output_dir : str ,
327
- mask_type : str ,
327
+ mask_type : ty .Literal ['brain' , 'roi' ],
328
+ extra_entities : dict | None = None ,
328
329
name = 'ds_mask_wf' ,
329
330
):
330
331
"""
@@ -336,6 +337,8 @@ def init_ds_mask_wf(
336
337
Root path of BIDS dataset
337
338
output_dir : :obj:`str`
338
339
Directory in which to save derivatives
340
+ extra_entities : :obj:`dict` or None
341
+ Additional entities to add to filename
339
342
name : :obj:`str`
340
343
Workflow name (default: ds_mask_wf)
341
344
@@ -363,12 +366,15 @@ def init_ds_mask_wf(
363
366
raw_sources = pe .Node (niu .Function (function = _bids_relative ), name = 'raw_sources' )
364
367
raw_sources .inputs .bids_root = bids_root
365
368
369
+ extra_entities = extra_entities or {}
370
+
366
371
ds_mask = pe .Node (
367
372
DerivativesDataSink (
368
373
base_directory = output_dir ,
369
374
desc = mask_type ,
370
375
suffix = 'mask' ,
371
376
compress = True ,
377
+ ** extra_entities ,
372
378
),
373
379
name = 'ds_anat_mask' ,
374
380
run_without_submitting = True ,
@@ -391,14 +397,21 @@ def init_ds_mask_wf(
391
397
return workflow
392
398
393
399
394
- def init_ds_dseg_wf (* , output_dir : str , name : str = 'ds_dseg_wf' ):
400
+ def init_ds_dseg_wf (
401
+ * ,
402
+ output_dir : str ,
403
+ extra_entities : dict | None = None ,
404
+ name : str = 'ds_dseg_wf' ,
405
+ ):
395
406
"""
396
407
Save discrete segmentations
397
408
398
409
Parameters
399
410
----------
400
411
output_dir : :obj:`str`
401
412
Directory in which to save derivatives
413
+ extra_entities : :obj:`dict` or None
414
+ Additional entities to add to filename
402
415
name : :obj:`str`
403
416
Workflow name (default: ds_dseg_wf)
404
417
@@ -423,12 +436,15 @@ def init_ds_dseg_wf(*, output_dir: str, name: str = 'ds_dseg_wf'):
423
436
)
424
437
outputnode = pe .Node (niu .IdentityInterface (fields = ['anat_dseg' ]), name = 'outputnode' )
425
438
439
+ extra_entities = extra_entities or {}
440
+
426
441
ds_anat_dseg = pe .Node (
427
442
DerivativesDataSink (
428
443
base_directory = output_dir ,
429
444
suffix = 'dseg' ,
430
445
compress = True ,
431
446
dismiss_entities = ['desc' ],
447
+ ** extra_entities ,
432
448
),
433
449
name = 'ds_anat_dseg' ,
434
450
run_without_submitting = True ,
@@ -448,6 +464,7 @@ def init_ds_dseg_wf(*, output_dir: str, name: str = 'ds_dseg_wf'):
448
464
def init_ds_tpms_wf (
449
465
* ,
450
466
output_dir : str ,
467
+ extra_entities : dict | None = None ,
451
468
name : str = 'ds_tpms_wf' ,
452
469
tpm_labels : tuple = BIDS_TISSUE_ORDER ,
453
470
):
@@ -458,6 +475,8 @@ def init_ds_tpms_wf(
458
475
----------
459
476
output_dir : :obj:`str`
460
477
Directory in which to save derivatives
478
+ extra_entities : :obj:`dict` or None
479
+ Additional entities to add to filename
461
480
name : :obj:`str`
462
481
Workflow name (default: anat_derivatives_wf)
463
482
tpm_labels : :obj:`tuple`
@@ -484,12 +503,15 @@ def init_ds_tpms_wf(
484
503
)
485
504
outputnode = pe .Node (niu .IdentityInterface (fields = ['anat_tpms' ]), name = 'outputnode' )
486
505
506
+ extra_entities = extra_entities or {}
507
+
487
508
ds_anat_tpms = pe .Node (
488
509
DerivativesDataSink (
489
510
base_directory = output_dir ,
490
511
suffix = 'probseg' ,
491
512
compress = True ,
492
513
dismiss_entities = ['desc' ],
514
+ ** extra_entities ,
493
515
),
494
516
name = 'ds_anat_tpms' ,
495
517
run_without_submitting = True ,
@@ -907,7 +929,7 @@ def init_ds_anat_volumes_wf(
907
929
inputnode = pe .Node (
908
930
niu .IdentityInterface (
909
931
fields = [
910
- # Original T1w image
932
+ # Original anat image
911
933
'source_files' ,
912
934
# anat-space images
913
935
'anat_preproc' ,
@@ -1036,6 +1058,7 @@ def init_ds_fs_segs_wf(
1036
1058
* ,
1037
1059
bids_root : str ,
1038
1060
output_dir : str ,
1061
+ extra_entities : dict | None = None ,
1039
1062
name = 'ds_fs_segs_wf' ,
1040
1063
):
1041
1064
"""
@@ -1047,6 +1070,8 @@ def init_ds_fs_segs_wf(
1047
1070
Root path of BIDS dataset
1048
1071
output_dir : :obj:`str`
1049
1072
Directory in which to save derivatives
1073
+ extra_entities : :obj:`dict` or None
1074
+ Additional entities to add to filename
1050
1075
name : :obj:`str`
1051
1076
Workflow name (default: ds_anat_segs_wf)
1052
1077
@@ -1075,15 +1100,27 @@ def init_ds_fs_segs_wf(
1075
1100
raw_sources = pe .Node (niu .Function (function = _bids_relative ), name = 'raw_sources' )
1076
1101
raw_sources .inputs .bids_root = bids_root
1077
1102
1103
+ extra_entities = extra_entities or {}
1104
+
1078
1105
# Parcellations
1079
1106
ds_anat_fsaseg = pe .Node (
1080
- DerivativesDataSink (base_directory = output_dir , desc = 'aseg' , suffix = 'dseg' , compress = True ),
1107
+ DerivativesDataSink (
1108
+ base_directory = output_dir ,
1109
+ desc = 'aseg' ,
1110
+ suffix = 'dseg' ,
1111
+ compress = True ,
1112
+ ** extra_entities ,
1113
+ ),
1081
1114
name = 'ds_anat_fsaseg' ,
1082
1115
run_without_submitting = True ,
1083
1116
)
1084
1117
ds_anat_fsparc = pe .Node (
1085
1118
DerivativesDataSink (
1086
- base_directory = output_dir , desc = 'aparcaseg' , suffix = 'dseg' , compress = True
1119
+ base_directory = output_dir ,
1120
+ desc = 'aparcaseg' ,
1121
+ suffix = 'dseg' ,
1122
+ compress = True ,
1123
+ ** extra_entities ,
1087
1124
),
1088
1125
name = 'ds_anat_fsparc' ,
1089
1126
run_without_submitting = True ,
0 commit comments