@@ -1402,16 +1402,16 @@ class ROIStatsInputSpec(CommandLineInputSpec):
1402
1402
quiet = traits .Bool (desc = 'execute quietly' ,
1403
1403
argstr = '-quiet' ,
1404
1404
position = 1 )
1405
-
1406
- terminal_output = traits .Enum ('allatonce' ,
1407
- desc = ('Control terminal output:'
1405
+
1406
+ terminal_output = traits .Enum ('allatonce' ,
1407
+ desc = ('Control terminal output:'
1408
1408
'`allatonce` - waits till command is '
1409
1409
'finished to display output' ),
1410
1410
nohash = True , mandatory = True , usedefault = True )
1411
1411
1412
1412
1413
1413
class ROIStatsOutputSpec (TraitedSpec ):
1414
- stats = OutputMultiPath ( traits . Float (), desc = 'output' , exists = True )
1414
+ stats = File ( desc = 'output tab separated values file ' , exists = True )
1415
1415
1416
1416
1417
1417
class ROIStats (CommandLine ):
@@ -1436,15 +1436,13 @@ class ROIStats(CommandLine):
1436
1436
output_spec = ROIStatsOutputSpec
1437
1437
1438
1438
def aggregate_outputs (self , runtime = None , needed_outputs = None ):
1439
-
1440
1439
outputs = self ._outputs ()
1441
- stats = []
1442
- for line in runtime .stdout .split ('\n ' ):
1443
- if line and not line .startswith ("File" ):
1444
- values = line .split ()
1445
- stats += [float (val ) for val in values [2 :]]
1446
-
1447
- outputs .stats = stats
1440
+ output_filename = "roi_stats.csv"
1441
+ f = open (output_filename , "w" )
1442
+ f .write (runtime .stdout )
1443
+ f .close ()
1444
+
1445
+ outputs .stats = os .path .abspath (output_filename )
1448
1446
return outputs
1449
1447
1450
1448
0 commit comments