@@ -1304,11 +1304,13 @@ class EddyQuadOutputSpec(TraitedSpec):
1304
1304
desc = ("Single subject database containing quality metrics and data "
1305
1305
"info." )
1306
1306
)
1307
+
1307
1308
out_qc_pdf = File (
1308
1309
exists = True ,
1309
1310
mandatory = True ,
1310
1311
desc = "Single subject QC report."
1311
1312
)
1313
+
1312
1314
out_avg_b_png = traits .List (
1313
1315
File (
1314
1316
exists = True ,
@@ -1317,6 +1319,7 @@ class EddyQuadOutputSpec(TraitedSpec):
1317
1319
"each averaged b-shell volume." )
1318
1320
)
1319
1321
)
1322
+
1320
1323
out_avg_b0_png = traits .List (
1321
1324
File (
1322
1325
exists = True ,
@@ -1326,6 +1329,7 @@ class EddyQuadOutputSpec(TraitedSpec):
1326
1329
"the -f option." )
1327
1330
)
1328
1331
)
1332
+
1329
1333
out_cnr_png = traits .List (
1330
1334
File (
1331
1335
exists = True ,
@@ -1335,19 +1339,22 @@ class EddyQuadOutputSpec(TraitedSpec):
1335
1339
"available." )
1336
1340
)
1337
1341
)
1342
+
1338
1343
out_vdm_png = File (
1339
1344
exists = True ,
1340
1345
mandatory = False ,
1341
1346
desc = ("Image showing mid-sagittal, -coronal and -axial slices of "
1342
1347
"the voxel displacement map. Generated when using the -f "
1343
1348
"option." )
1344
1349
)
1350
+
1345
1351
out_residuals = File (
1346
1352
exists = True ,
1347
1353
mandatory = False ,
1348
1354
desc = ("Text file containing the volume-wise mask-averaged squared "
1349
1355
"residuals. Generated when residual maps are available." )
1350
1356
)
1357
+
1351
1358
out_clean_volumes = File (
1352
1359
exists = True ,
1353
1360
mandatory = False ,
@@ -1396,52 +1403,48 @@ def __init__(self, **inputs):
1396
1403
super (EddyQuad , self ).__init__ (** inputs )
1397
1404
1398
1405
def _list_outputs (self ):
1406
+ from glob import glob
1399
1407
outputs = self .output_spec ().get ()
1400
1408
out_dir = self .inputs .output_dir
1401
1409
outputs ['out_qc_json' ] = os .path .abspath (
1402
- os .path .join (self . inputs . output_dir , 'out .json' )
1410
+ os .path .join (out_dir , 'qc .json' )
1403
1411
)
1404
- outputs ['out_qc_json ' ] = os .path .abspath (
1405
- os .path .join (self . inputs . output_dir , 'out.json ' )
1412
+ outputs ['out_qc_pdf ' ] = os .path .abspath (
1413
+ os .path .join (out_dir , 'qc.pdf ' )
1406
1414
)
1407
- outputs ['out_parameter' ] = os .path .abspath (
1408
- '%s.eddy_parameters' % self .inputs .out_base )
1409
1415
1410
- # File generation might depend on the version of EDDY
1411
- out_rotated_bvecs = os .path .abspath (
1412
- '%s.eddy_rotated_bvecs' % self .inputs .out_base )
1413
- out_movement_rms = os .path .abspath (
1414
- '%s.eddy_movement_rms' % self .inputs .out_base )
1415
- out_restricted_movement_rms = os .path .abspath (
1416
- '%s.eddy_restricted_movement_rms' % self .inputs .out_base )
1417
- out_shell_alignment_parameters = os .path .abspath (
1418
- '%s.eddy_post_eddy_shell_alignment_parameters' %
1419
- self .inputs .out_base )
1420
- out_outlier_report = os .path .abspath (
1421
- '%s.eddy_outlier_report' % self .inputs .out_base )
1422
- if isdefined (self .inputs .cnr_maps ) and self .inputs .cnr_maps :
1423
- out_cnr_maps = os .path .abspath (
1424
- '%s.eddy_cnr_maps.nii.gz' % self .inputs .out_base )
1425
- if os .path .exists (out_cnr_maps ):
1426
- outputs ['out_cnr_maps' ] = out_cnr_maps
1427
- if isdefined (self .inputs .residuals ) and self .inputs .residuals :
1428
- out_residuals = os .path .abspath (
1429
- '%s.eddy_residuals.nii.gz' % self .inputs .out_base )
1430
- if os .path .exists (out_residuals ):
1431
- outputs ['out_residuals' ] = out_residuals
1416
+ outputs ['out_avg_b0_png' ] = glob (os .path .abspath (
1417
+ os .path .join (out_dir , 'avg_b0_pe*.png' )
1418
+ ))
1432
1419
1433
- if os .path .exists (out_rotated_bvecs ):
1434
- outputs ['out_rotated_bvecs' ] = out_rotated_bvecs
1435
- if os .path .exists (out_movement_rms ):
1436
- outputs ['out_movement_rms' ] = out_movement_rms
1437
- if os .path .exists (out_restricted_movement_rms ):
1438
- outputs ['out_restricted_movement_rms' ] = \
1439
- out_restricted_movement_rms
1440
- if os .path .exists (out_shell_alignment_parameters ):
1441
- outputs ['out_shell_alignment_parameters' ] = \
1442
- out_shell_alignment_parameters
1443
- if os .path .exists (out_outlier_report ):
1444
- outputs ['out_outlier_report' ] = out_outlier_report
1420
+ outputs ['out_avg_b_png' ] = [b for b in glob (os .path .abspath (
1421
+ os .path .join (out_dir , 'avg_b*.png' )
1422
+ )) if b not in outputs ['out_avg_b0_png' ]]
1423
+
1424
+ outputs ['out_cnr_png' ] = glob (os .path .abspath (
1425
+ os .path .join (out_dir , 'cnr*.png' )
1426
+ ))
1427
+
1428
+ vdm = os .path .abspath (
1429
+ os .path .join (out_dir , 'vdm.png' )
1430
+ )
1431
+
1432
+ if os .path .exists (vdm ):
1433
+ outputs ['out_vdm_png' ] = vdm
1434
+
1435
+ residuals = os .path .abspath (
1436
+ os .path .join (out_dir , 'eddy_msr.txt' )
1437
+ )
1438
+
1439
+ if os .path .exists (residuals ):
1440
+ outputs ['out_residuals' ] = residuals
1441
+
1442
+ outlier_vols = os .path .abspath (
1443
+ os .path .join (out_dir , 'vols_no_outliers.txt' )
1444
+ )
1445
+
1446
+ if os .path .exists (outlier_vols ):
1447
+ outputs ['out_clean_volumes' ] = outlier_vols
1445
1448
1446
1449
return outputs
1447
1450
0 commit comments