@@ -1358,12 +1358,12 @@ class LocalBistatInputSpec(AFNICommandInputSpec):
1358
1358
'\' SPHERE\' , \' RHDD\' (rhombic dodecahedron), \' TOHD\' '
1359
1359
'(truncated octahedron) with a given radius in mm or '
1360
1360
'\' RECT\' (rectangular block) with dimensions to specify in mm.' ,
1361
- argstr = ' -nbhd %s' )
1361
+ argstr = " -nbhd '%s(%s)'" )
1362
1362
_stat_names = ['pearson' , 'spearman' , 'quadrant' , 'mutinfo' , 'normuti' ,
1363
1363
'jointent' , 'hellinger' , 'crU' , 'crM' , 'crA' , 'L2slope' ,
1364
1364
'L1slope' , 'num' , 'ALL' ]
1365
- stat = traits . Either (
1366
- traits .Enum (* _stat_names ), traits . List ( traits . Enum ( _stat_names ) ),
1365
+ stat = InputMultiPath (
1366
+ traits .Enum (_stat_names ),
1367
1367
mandatory = True ,
1368
1368
desc = 'statistics to compute. Possible names are :'
1369
1369
' * pearson = Pearson correlation coefficient'
@@ -1389,16 +1389,18 @@ class LocalBistatInputSpec(AFNICommandInputSpec):
1389
1389
' map that size.'
1390
1390
' * ALL = all of the above, in that order'
1391
1391
'More than one option can be used.' ,
1392
- argstr = '-stat %s' )
1392
+ argstr = '-stat %s... ' )
1393
1393
mask_file = traits .File (
1394
1394
exists = True ,
1395
1395
desc = 'mask image file name. Voxels NOT in the mask will not be used '
1396
1396
'in the neighborhood of any voxel. Also, a voxel NOT in the mask '
1397
1397
'will have its statistic(s) computed as zero (0).' ,
1398
1398
argstr = '-mask %s' )
1399
1399
automask = traits .Bool (
1400
- desc = 'Compute the mask as in program 3dAutomask.' )
1401
- mask_file = traits .File (
1400
+ desc = 'Compute the mask as in program 3dAutomask.' ,
1401
+ argstr = '-automask' ,
1402
+ xor = ['weight_file' ])
1403
+ weight_file = traits .File (
1402
1404
exists = True ,
1403
1405
desc = 'File name of an image to use as a weight. Only applies to '
1404
1406
'\' pearson\' statistics.' ,
@@ -1440,19 +1442,9 @@ class LocalBistat(AFNICommand):
1440
1442
output_spec = AFNICommandOutputSpec
1441
1443
1442
1444
def _format_arg (self , name , spec , value ):
1443
- if name == 'neighborhood' :
1444
- region_name , region_size = value
1445
- if region_name == 'RECT' :
1446
- return spec .argstr % (
1447
- "'{0}({1})'" .format (region_name , ',' .join (region_size )))
1448
- else :
1449
- return spec .argstr % (
1450
- "'{0}({1})'" .format (region_name , region_size ))
1451
- if name == 'stat' :
1452
- if isinstance (value , (str , bytes )):
1453
- return spec .argstr % value
1454
- else :
1455
- return ' ' .join ([spec .argstr % v for v in value ])
1445
+ if name == 'neighborhood' and value [0 ] == 'RECT' :
1446
+ value = ('RECT' , '%s,%s,%s' % value [1 ])
1447
+
1456
1448
return super (LocalBistat , self )._format_arg (name , spec , value )
1457
1449
1458
1450
0 commit comments