@@ -1304,11 +1304,13 @@ class EddyQuadOutputSpec(TraitedSpec):
13041304 desc = ("Single subject database containing quality metrics and data "
13051305 "info." )
13061306 )
1307+
13071308 out_qc_pdf = File (
13081309 exists = True ,
13091310 mandatory = True ,
13101311 desc = "Single subject QC report."
13111312 )
1313+
13121314 out_avg_b_png = traits .List (
13131315 File (
13141316 exists = True ,
@@ -1317,6 +1319,7 @@ class EddyQuadOutputSpec(TraitedSpec):
13171319 "each averaged b-shell volume." )
13181320 )
13191321 )
1322+
13201323 out_avg_b0_png = traits .List (
13211324 File (
13221325 exists = True ,
@@ -1326,6 +1329,7 @@ class EddyQuadOutputSpec(TraitedSpec):
13261329 "the -f option." )
13271330 )
13281331 )
1332+
13291333 out_cnr_png = traits .List (
13301334 File (
13311335 exists = True ,
@@ -1335,19 +1339,22 @@ class EddyQuadOutputSpec(TraitedSpec):
13351339 "available." )
13361340 )
13371341 )
1342+
13381343 out_vdm_png = File (
13391344 exists = True ,
13401345 mandatory = False ,
13411346 desc = ("Image showing mid-sagittal, -coronal and -axial slices of "
13421347 "the voxel displacement map. Generated when using the -f "
13431348 "option." )
13441349 )
1350+
13451351 out_residuals = File (
13461352 exists = True ,
13471353 mandatory = False ,
13481354 desc = ("Text file containing the volume-wise mask-averaged squared "
13491355 "residuals. Generated when residual maps are available." )
13501356 )
1357+
13511358 out_clean_volumes = File (
13521359 exists = True ,
13531360 mandatory = False ,
@@ -1396,52 +1403,48 @@ def __init__(self, **inputs):
13961403 super (EddyQuad , self ).__init__ (** inputs )
13971404
13981405 def _list_outputs (self ):
1406+ from glob import glob
13991407 outputs = self .output_spec ().get ()
14001408 out_dir = self .inputs .output_dir
14011409 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' )
14031411 )
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 ' )
14061414 )
1407- outputs ['out_parameter' ] = os .path .abspath (
1408- '%s.eddy_parameters' % self .inputs .out_base )
14091415
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+ ))
14321419
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
14451448
14461449 return outputs
14471450
0 commit comments