@@ -124,7 +124,6 @@ class TOPUPInputSpec(FSLCommandInputSpec):
124
124
out_base = File (desc = ('base-name of output files (spline '
125
125
'coefficients (Hz) and movement parameters)' ),
126
126
name_source = ['in_file' ], name_template = '%s_base' ,
127
- keep_extension = True ,
128
127
argstr = '--out=%s' , hash_files = False )
129
128
out_field = File (argstr = '--fout=%s' , hash_files = False ,
130
129
name_source = ['in_file' ], name_template = '%s_field' ,
@@ -254,16 +253,38 @@ def _generate_encfile(self):
254
253
np .savetxt (out_file , np .array (lines ), fmt = '%d %d %d %.3f' )
255
254
return out_file
256
255
257
- class ApplyTOPUPInputSpec ( FSLCommandInputSpec ):
258
- in_files = InputMultiPath (File (exists = True ), mandatory = True , desc = 'name of 4D file with images' , argstr = '%s' )
259
- encoding_file = File ( exists = True , mandatory = True , desc = 'name of text file with PE directions/times' , argstr = '--datain=%s' )
260
- in_index = traits .List ( argstr = '%s' , mandatory = True , desc = 'comma separated list of indicies into --datain of the input image (to be corrected)' )
261
- in_topup = File ( mandatory = True , desc = 'basename of field/movements (from topup)' , argstr = '--topup=%s' )
256
+ def _overload_extension (self , value , name = None ):
257
+ if name == 'out_base' :
258
+ return value
259
+ return super (TOPUP , self )._overload_extension (value , name )
262
260
263
- out_base = File ( desc = 'basename for output (warped) image' , argstr = '--out=%s' )
264
- method = traits .Enum ( ('jac' ,'lsr' ), argstr = '--method=%s' , desc = 'use jacobian modulation (jac) or least-squares resampling (lsr)' )
265
- interp = traits .Enum ( ('trilinear' ,'spline' ), argstr = '--interp=%s' , desc = 'interpolation method' )
266
- datatype = traits .Enum ( ('char' , 'short' , 'int' , 'float' , 'double' ), argstr = '-d=%s' , desc = 'force output data type' )
261
+
262
+ class ApplyTOPUPInputSpec (FSLCommandInputSpec ):
263
+ in_files = InputMultiPath (File (exists = True ), mandatory = True ,
264
+ desc = 'name of 4D file with images' , argstr = '%s' )
265
+ encoding_file = File (exists = True , mandatory = True ,
266
+ desc = 'name of text file with PE directions/times' ,
267
+ argstr = '--datain=%s' )
268
+ in_index = traits .List (argstr = '%s' , mandatory = True ,
269
+ desc = ('comma separated list of indicies into '
270
+ '--datain of the input image (to be '
271
+ 'corrected)' ))
272
+ in_topup_fieldcoef = File (exists = True , argstr = "--topup=%s" , copyfile = False ,
273
+ requires = ['in_topup_movpar' ],
274
+ desc = ('topup file containing the field '
275
+ 'coefficients' ))
276
+ in_topup_movpar = File (exists = True , requires = ['in_topup_fieldcoef' ],
277
+ copyfile = False , desc = 'topup movpar.txt file' )
278
+ out_corrected = File (desc = 'output (warped) image' ,
279
+ name_source = ['in_files' ], name_template = '%s_corrected' ,
280
+ argstr = '--out=%s' )
281
+ method = traits .Enum (('jac' ,'lsr' ), argstr = '--method=%s' ,
282
+ desc = ('use jacobian modulation (jac) or least-squares '
283
+ 'resampling (lsr)' ))
284
+ interp = traits .Enum (('trilinear' ,'spline' ), argstr = '--interp=%s' ,
285
+ desc = 'interpolation method' )
286
+ datatype = traits .Enum (('char' , 'short' , 'int' , 'float' , 'double' ),
287
+ argstr = '-d=%s' , desc = 'force output data type' )
267
288
268
289
269
290
class ApplyTOPUPOutputSpec ( TraitedSpec ):
0 commit comments