@@ -400,8 +400,9 @@ class FLIRTInputSpec(FSLCommandInputSpec):
400
400
name_template = '%s_flirt.log' , desc = 'output log' )
401
401
in_matrix_file = File (argstr = '-init %s' , desc = 'input 4x4 affine matrix' )
402
402
apply_xfm = traits .Bool (
403
- argstr = '-applyxfm' , requires = ['in_matrix_file' ],
404
- desc = 'apply transformation supplied by in_matrix_file' )
403
+ argstr = '-applyxfm' ,
404
+ desc = ('apply transformation supplied by in_matrix_file or uses_qform to'
405
+ ' use the affine matrix stored in the reference header' ))
405
406
apply_isoxfm = traits .Float (
406
407
argstr = '-applyisoxfm %f' , xor = ['apply_xfm' ],
407
408
desc = 'as applyxfm but forces isotropic resampling' )
@@ -561,13 +562,18 @@ def _parse_inputs(self, skip=None):
561
562
if isdefined (self .inputs .save_log ) and self .inputs .save_log :
562
563
if not isdefined (self .inputs .verbose ) or self .inputs .verbose == 0 :
563
564
self .inputs .verbose = 1
565
+ if isdefined (self .inputs .apply_xfm ) and self .inputs .apply_xfm :
566
+ if not self .inputs .in_matrix_file or not self .inputs .uses_qform :
567
+ raise RuntimeError ('Argument apply_xfm requires in_matrix_file '
568
+ 'or uses_qform arguments to run' )
564
569
skip .append ('save_log' )
565
570
return super (FLIRT , self )._parse_inputs (skip = skip )
566
571
567
572
class ApplyXFMInputSpec (FLIRTInputSpec ):
568
573
apply_xfm = traits .Bool (
569
- True , argstr = '-applyxfm' , requires = ['in_matrix_file' ],
570
- desc = 'apply transformation supplied by in_matrix_file' ,
574
+ True , argstr = '-applyxfm' ,
575
+ desc = ('apply transformation supplied by in_matrix_file or uses_qform to'
576
+ ' use the affine matrix stored in the reference header' ),
571
577
usedefault = True )
572
578
573
579
0 commit comments