@@ -1159,6 +1159,8 @@ class BBRegisterInputSpec(FSTraitedSpec):
1159
1159
desc = "write the transformation matrix in LTA format" )
1160
1160
registered_file = traits .Either (traits .Bool , File , argstr = '--o %s' ,
1161
1161
desc = 'output warped sourcefile either True or filename' )
1162
+ init_cost_file = traits .Either (traits .Bool , File , argstr = '--initcost %s' ,
1163
+ desc = 'output initial registration cost file' )
1162
1164
1163
1165
1164
1166
class BBRegisterInputSpec6 (BBRegisterInputSpec ):
@@ -1172,10 +1174,11 @@ class BBRegisterInputSpec6(BBRegisterInputSpec):
1172
1174
1173
1175
class BBRegisterOutputSpec (TraitedSpec ):
1174
1176
out_reg_file = File (exists = True , desc = 'Output registration file' )
1175
- out_fsl_file = File (desc = 'Output FLIRT-style registration file' )
1176
- out_lta_file = File (desc = 'Output LTA-style registration file' )
1177
+ out_fsl_file = File (exists = True , desc = 'Output FLIRT-style registration file' )
1178
+ out_lta_file = File (exists = True , desc = 'Output LTA-style registration file' )
1177
1179
min_cost_file = File (exists = True , desc = 'Output registration minimum cost file' )
1178
- registered_file = File (desc = 'Registered and resampled source file' )
1180
+ init_cost_file = File (exists = True , desc = 'Output initial registration cost file' )
1181
+ registered_file = File (exists = True , desc = 'Registered and resampled source file' )
1179
1182
1180
1183
1181
1184
class BBRegister (FSCommand ):
@@ -1242,17 +1245,19 @@ def _list_outputs(self):
1242
1245
else :
1243
1246
outputs ['out_fsl_file' ] = op .abspath (_in .out_fsl_file )
1244
1247
1248
+ if isdefined (_in .init_cost_file ):
1249
+ if isinstance (_in .out_fsl_file , bool ):
1250
+ outputs ['init_cost_file' ] = outputs ['out_reg_file' ] + '.initcost'
1251
+ else :
1252
+ outputs ['init_cost_file' ] = op .abspath (_in .init_cost_file )
1253
+
1245
1254
outputs ['min_cost_file' ] = outputs ['out_reg_file' ] + '.mincost'
1246
1255
return outputs
1247
1256
1248
1257
def _format_arg (self , name , spec , value ):
1249
-
1250
- if name in ['registered_file' , 'out_fsl_file' , 'out_lta_file' ]:
1251
- if isinstance (value , bool ):
1252
- fname = self ._list_outputs ()[name ]
1253
- else :
1254
- fname = value
1255
- return spec .argstr % fname
1258
+ if name in ('registered_file' , 'out_fsl_file' , 'out_lta_file' ,
1259
+ 'init_cost_file' ) and isinstance (value , bool ):
1260
+ value = self ._list_outputs ()[name ]
1256
1261
return super (BBRegister , self )._format_arg (name , spec , value )
1257
1262
1258
1263
def _gen_filename (self , name ):
0 commit comments