@@ -163,9 +163,9 @@ class ComposeXfmInputSpec(CommandLineInputSpec):
163
163
argstr = "-df %s" , copyfile = False , mandatory = True )
164
164
in_aff = File (desc = 'affine transform file' , exists = True ,
165
165
argstr = "-aff %s" , mandatory = True )
166
- out_file = traits . File (desc = 'output path' ,
167
- argstr = "-out %s" , name_source = "in_df" ,
168
- name_template = "%s_aff.df" , keep_extension = True )
166
+ out_file = File (desc = 'output path' ,
167
+ argstr = "-out %s" , name_source = "in_df" ,
168
+ name_template = "%s_aff.df" , keep_extension = True )
169
169
170
170
171
171
class ComposeXfmOutputSpec (TraitedSpec ):
@@ -196,9 +196,9 @@ class ComposeXfm(CommandLineDtitk):
196
196
class affSymTensor3DVolInputSpec (CommandLineInputSpec ):
197
197
in_file = File (desc = 'moving tensor volume' , exists = True ,
198
198
argstr = "-in %s" , mandatory = True )
199
- out_file = traits . File (desc = 'output filename' ,
200
- argstr = "-out %s" , name_source = "in_file" ,
201
- name_template = "%s_affxfmd" , keep_extension = True )
199
+ out_file = File (desc = 'output filename' ,
200
+ argstr = "-out %s" , name_source = "in_file" ,
201
+ name_template = "%s_affxfmd" , keep_extension = True )
202
202
transform = File (exists = True , argstr = "-trans %s" ,
203
203
xor = ['target' , 'translation' , 'euler' , 'deformation' ],
204
204
desc = 'transform to apply: specify an input transformation\
@@ -254,16 +254,17 @@ class affSymTensor3DVol(CommandLineDtitk):
254
254
class affScalarVolInputSpec (CommandLineInputSpec ):
255
255
in_file = File (desc = 'moving scalar volume' , exists = True ,
256
256
argstr = "-in %s" , mandatory = True )
257
- out_file = traits . File (desc = 'output filename' ,
258
- argstr = "-out %s" , name_source = "in_file" ,
259
- name_template = "%s_affxfmd" , keep_extension = True )
257
+ out_file = File (desc = 'output filename' ,
258
+ argstr = "-out %s" , name_source = "in_file" ,
259
+ name_template = "%s_affxfmd" , keep_extension = True )
260
260
transform = File (exists = True , argstr = "-trans %s" ,
261
261
xor = ['target' , 'translation' , 'euler' , 'deformation' ],
262
262
desc = 'transform to apply: specify an input transformation\
263
263
file; parameters input will be ignored' ,)
264
- interpolation = traits .Enum (0 , 1 , usedefault = True ,
265
- argstr = "-interp %s" ,
266
- desc = '0=trilinear (def); 1=nearest neighbor' )
264
+ interpolation = traits .Enum ('trilinear' , 'NN' ,
265
+ usedefault = True , argstr = "-interp %s" ,
266
+ desc = 'trilinear or nearest neighbor\
267
+ interpolation' )
267
268
target = File (exists = True , argstr = "-target %s" , xor = ['transform' ],
268
269
desc = 'output volume specification read from the target volume\
269
270
if specified' )
@@ -301,13 +302,18 @@ class affScalarVol(CommandLineDtitk):
301
302
output_spec = affScalarVolOutputSpec
302
303
_cmd = 'affineScalarVolume'
303
304
305
+ def _format_arg (self , name , spec , value ):
306
+ if name == 'interpolation' :
307
+ value = {'trilinear' : 0 , 'NN' : 1 }[value ]
308
+ super (affScalarVol , self )._format_arg (name , spec , value )
309
+
304
310
305
311
class diffeoSymTensor3DVolInputSpec (CommandLineInputSpec ):
306
312
in_file = File (desc = 'moving tensor volume' , exists = True ,
307
313
argstr = "-in %s" , mandatory = True )
308
- out_file = traits . File (desc = 'output filename' ,
309
- argstr = "-out %s" , name_source = "in_file" ,
310
- name_template = "%s_diffeoxfmd" , keep_extension = True )
314
+ out_file = File (desc = 'output filename' ,
315
+ argstr = "-out %s" , name_source = "in_file" ,
316
+ name_template = "%s_diffeoxfmd" , keep_extension = True )
311
317
transform = File (exists = True , argstr = "-trans %s" ,
312
318
mandatory = True , desc = 'transform to apply' )
313
319
df = traits .Str ('FD' , argstr = "-df %s" , usedefault = True )
@@ -326,7 +332,8 @@ class diffeoSymTensor3DVolInputSpec(CommandLineInputSpec):
326
332
argstr = "-vsize %g %g %g" , xor = ['target' ])
327
333
flip = traits .Tuple ((traits .Int (), traits .Int (), traits .Int ()),
328
334
exists = True , argstr = "-flip %d %d %d" )
329
- resampling_type = traits .Enum (1 , 0 , desc = '1=backward(def), 0=forward' ,
335
+ resampling_type = traits .Enum ('backward' , 'forward' ,
336
+ desc = 'use backward or forward resampling' ,
330
337
exists = True , argstr = "-type %d" )
331
338
332
339
@@ -355,13 +362,18 @@ class diffeoSymTensor3DVol(CommandLineDtitk):
355
362
output_spec = diffeoSymTensor3DVolOutputSpec
356
363
_cmd = 'deformationSymTensor3DVolume'
357
364
365
+ def _format_arg (self , name , spec , value ):
366
+ if name == 'resampling_type' :
367
+ value = {'forward' : 0 , 'backward' : 1 }[value ]
368
+ super (diffeoSymTensor3DVol , self )._format_arg (name , spec , value )
369
+
358
370
359
371
class diffeoScalarVolInputSpec (CommandLineInputSpec ):
360
372
in_file = File (desc = 'moving scalar volume' , exists = True ,
361
373
argstr = "-in %s" , mandatory = True )
362
- out_file = traits . File (desc = 'output filename' ,
363
- argstr = "-out %s" , name_source = "in_file" ,
364
- name_template = "%s_diffeoxfmd" , keep_extension = True )
374
+ out_file = File (desc = 'output filename' ,
375
+ argstr = "-out %s" , name_source = "in_file" ,
376
+ name_template = "%s_diffeoxfmd" , keep_extension = True )
365
377
transform = transform = File (exists = True , argstr = "-trans %s" ,
366
378
mandatory = True , desc = 'transform to apply' )
367
379
target = File (exists = True , argstr = "-target %s" , xor = ['voxel_size' ],
@@ -372,10 +384,13 @@ class diffeoScalarVolInputSpec(CommandLineInputSpec):
372
384
argstr = "-vsize %g %g %g" , xor = ['target' ])
373
385
flip = traits .Tuple ((traits .Int (), traits .Int (), traits .Int ()),
374
386
exists = True , argstr = "-flip %d %d %d" )
375
- resampling_type = traits .Enum (1 , 0 , desc = '1=backward(def), 0=forward' ,
387
+ resampling_type = traits .Enum ('backward' , 'forward' ,
388
+ desc = 'use backward or forward resampling' ,
376
389
exists = True , argstr = "-type %d" )
377
- interp = traits .Enum (0 , 1 , desc = '0=trilinear(def), 1=nearest neighbor' ,
378
- exists = True , argstr = "-interp %d" , usedefault = True )
390
+ interpolation = traits .Enum ('trilinear' , 'NN' ,
391
+ desc = 'trilinear, or nearest neighbor' ,
392
+ exists = True , argstr = "-interp %d" ,
393
+ usedefault = True )
379
394
380
395
381
396
class diffeoScalarVolOutputSpec (TraitedSpec ):
@@ -402,3 +417,11 @@ class diffeoScalarVol(CommandLineDtitk):
402
417
input_spec = diffeoScalarVolInputSpec
403
418
output_spec = diffeoScalarVolOutputSpec
404
419
_cmd = 'deformationScalarVolume'
420
+
421
+ def _format_arg (self , name , spec , value ):
422
+ if name == 'resampling_type' :
423
+ value = {'forward' : 0 , 'backward' : 1 }[value ]
424
+ super (diffeoScalarVol , self )._format_arg (name , spec , value )
425
+ if name == 'interpolation' :
426
+ value = {'trilinear' : 0 , 'NN' : 1 }[value ]
427
+ super (diffeoScalarVol , self )._format_arg (name , spec , value )
0 commit comments