@@ -1159,6 +1159,8 @@ class BBRegisterInputSpec(FSTraitedSpec):
11591159 desc = "write the transformation matrix in LTA format" )
11601160 registered_file = traits .Either (traits .Bool , File , argstr = '--o %s' ,
11611161 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' )
11621164
11631165
11641166class BBRegisterInputSpec6 (BBRegisterInputSpec ):
@@ -1172,10 +1174,11 @@ class BBRegisterInputSpec6(BBRegisterInputSpec):
11721174
11731175class BBRegisterOutputSpec (TraitedSpec ):
11741176 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' )
11771179 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' )
11791182
11801183
11811184class BBRegister (FSCommand ):
@@ -1242,17 +1245,19 @@ def _list_outputs(self):
12421245 else :
12431246 outputs ['out_fsl_file' ] = op .abspath (_in .out_fsl_file )
12441247
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+
12451254 outputs ['min_cost_file' ] = outputs ['out_reg_file' ] + '.mincost'
12461255 return outputs
12471256
12481257 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 ]
12561261 return super (BBRegister , self )._format_arg (name , spec , value )
12571262
12581263 def _gen_filename (self , name ):
0 commit comments