@@ -247,12 +247,9 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec):
247247 traits .Tuple (traits .Float (), # Gaussian/MultiLabel (sigma, alpha)
248248 traits .Float ())
249249 )
250- transforms = traits .Either (InputMultiPath (File (exists = True ), desc = 'transform files: will be '
251- 'applied in reverse order. For example, the last '
252- 'specified transform will be applied first.' ),
253- traits .Enum ('identity' , desc = 'use the identity transform' ),
254- mandatory = True ,
255- argstr = '%s' )
250+ transforms = InputMultiPath (File (exists = True ), argstr = '%s' , mandatory = True ,
251+ desc = 'transform files: will be applied in reverse order. For '
252+ 'example, the last specified transform will be applied first.' )
256253 invert_transform_flags = InputMultiPath (traits .Bool ())
257254 default_value = traits .Float (0.0 , argstr = '--default-value %g' , usedefault = True )
258255 print_out_composite_warp_file = traits .Bool (False , requires = ["output_image" ],
@@ -300,20 +297,6 @@ class ApplyTransforms(ANTSCommand):
300297 'antsApplyTransforms --default-value 0 --dimensionality 3 --input moving1.nii --interpolation BSpline[ 5 ] \
301298 --output deformed_moving1.nii --reference-image fixed1.nii --transform [ ants_Warp.nii.gz, 0 ] \
302299 --transform [ trans.mat, 0 ]'
303-
304- >>> atid = ApplyTransforms()
305- >>> atid.inputs.dimension = 3
306- >>> atid.inputs.input_image = 'moving1.nii'
307- >>> atid.inputs.reference_image = 'fixed1.nii'
308- >>> atid.inputs.output_image = 'deformed_moving1.nii'
309- >>> atid.inputs.interpolation = 'BSpline'
310- >>> atid.inputs.interpolation_parameters = (5,)
311- >>> atid.inputs.default_value = 0
312- >>> atid.inputs.transforms = 'identity'
313- >>> atid.cmdline # doctest: +IGNORE_UNICODE
314- 'antsApplyTransforms --default-value 0 --dimensionality 3 --input moving1.nii \
315- --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii \
316- --transform identity'
317300 """
318301 _cmd = 'antsApplyTransforms'
319302 input_spec = ApplyTransformsInputSpec
@@ -329,9 +312,6 @@ def _gen_filename(self, name):
329312 return None
330313
331314 def _get_transform_filenames (self ):
332- ''' the input transforms may be a list of files or the keyword 'identity' '''
333- if self .inputs .transforms == 'identity' :
334- return "--transform identity"
335315 retval = []
336316 for ii in range (len (self .inputs .transforms )):
337317 if isdefined (self .inputs .invert_transform_flags ):
0 commit comments