@@ -79,6 +79,8 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"):
79
79
the FoV
80
80
metadata : dict
81
81
BIDS metadata for BOLD file
82
+ name : str
83
+ Name of workflow (default: ``bold_confs_wf``)
82
84
83
85
**Inputs**
84
86
@@ -270,12 +272,55 @@ def _pick_wm(files):
270
272
return workflow
271
273
272
274
273
- def init_carpetplot_wf (mem_gb , metadata , name = "bold_confs_wf" ):
275
+ def init_carpetplot_wf (mem_gb , metadata , name = "bold_carpet_wf" ):
276
+ """
277
+
278
+ Resamples the MNI parcellation (ad-hoc parcellation derived from the
279
+ Harvard-Oxford template and others).
280
+
281
+ **Parameters**
282
+
283
+ mem_gb : float
284
+ Size of BOLD file in GB - please note that this size
285
+ should be calculated after resamplings that may extend
286
+ the FoV
287
+ metadata : dict
288
+ BIDS metadata for BOLD file
289
+ name : str
290
+ Name of workflow (default: ``bold_carpet_wf``)
291
+
292
+ **Inputs**
293
+
294
+ bold
295
+ BOLD image, after the prescribed corrections (STC, HMC and SDC)
296
+ when available.
297
+ bold_mask
298
+ BOLD series mask
299
+ confounds_file
300
+ TSV of all aggregated confounds
301
+ t1_bold_xform
302
+ Affine matrix that maps the T1w space into alignment with
303
+ the native BOLD space
304
+ t1_2_mni_reverse_transform
305
+ ANTs-compatible affine-and-warp transform file
306
+
307
+ **Outputs**
308
+
309
+ out_carpetplot
310
+ Path of the generated SVG file
274
311
312
+ """
275
313
inputnode = pe .Node (niu .IdentityInterface (
276
- fields = ['bold' , 'bold_mask' , 'confounds_file' , 'bold_mni_transforms' ]),
314
+ fields = ['bold' , 'bold_mask' , 'confounds_file' ,
315
+ 't1_bold_xform' , 't1_2_mni_reverse_transform' ]),
277
316
name = 'inputnode' )
278
317
318
+ outputnode = pe .Node (niu .IdentityInterface (
319
+ fields = ['out_carpetplot' ]), name = 'outputnode' )
320
+
321
+ # List transforms
322
+ mrg_xfms = pe .Node (niu .Merge (2 ), name = 'mrg_xfms' )
323
+
279
324
# Warp segmentation into EPI space
280
325
resample_parc = pe .Node (ApplyTransforms (
281
326
float = True ,
@@ -299,26 +344,20 @@ def init_carpetplot_wf(mem_gb, metadata, name="bold_confs_wf"):
299
344
name = 'ds_report_bold_conf' , run_without_submitting = True ,
300
345
mem_gb = DEFAULT_MEMORY_MIN_GB )
301
346
302
- def _reversed (inlist ):
303
- return list (reversed (inlist ))
304
-
305
- def _flags (inlist ):
306
- return [True ] * len (inlist )
307
-
308
347
workflow = pe .Workflow (name = name )
309
348
workflow .connect ([
310
- (inputnode , resample_parc , [
311
- ( 'bold_mask ' , 'reference_image' ),
312
- (( 'bold_mni_transforms ' , _reversed ), 'transforms' ),
313
- (( 'bold_mni_transforms ' , _flags ), 'invert_transform_flags ' )]),
349
+ (inputnode , mrg_xfms , [( 't1_bold_xform' , 'in1' ),
350
+ ( 't1_2_mni_reverse_transform ' , 'in2' )] ),
351
+ ( inputnode , resample_parc , [( 'bold_mask ' , 'reference_image' )] ),
352
+ ( mrg_xfms , resample_parc , [( 'out ' , 'transforms ' )]),
314
353
# Carpetplot
315
354
(inputnode , conf_plot , [
316
355
('bold' , 'in_func' ),
317
356
('bold_mask' , 'in_mask' ),
318
357
('confounds_file' , 'confounds_file' )]),
319
358
(resample_parc , conf_plot , [('output_image' , 'in_segm' )]),
320
359
(conf_plot , ds_report_bold_conf , [('out_file' , 'in_file' )]),
321
-
360
+ ( conf_plot , outputnode , [( 'out_file' , 'out_carpetplot' )]),
322
361
])
323
362
return workflow
324
363
0 commit comments