Skip to content

Commit 785f6dd

Browse files
committed
Merge pull request #913 from juhuntenburg/fix/applywarp
Fix/applywarp
2 parents eecbe69 + 6b328f0 commit 785f6dd

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

nipype/interfaces/fsl/preprocess.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -941,18 +941,18 @@ def write_config(self, configfile):
941941

942942
class ApplyWarpInputSpec(FSLCommandInputSpec):
943943
in_file = File(exists=True, argstr='--in=%s',
944-
mandatory=True,
944+
mandatory=True, position=0,
945945
desc='image to be warped')
946-
out_file = File(argstr='--out=%s', genfile=True,
946+
out_file = File(argstr='--out=%s', genfile=True, position=2,
947947
desc='output filename', hash_files=False)
948948
ref_file = File(exists=True, argstr='--ref=%s',
949-
mandatory=True,
949+
mandatory=True, position=1,
950950
desc='reference image')
951951
field_file = File(exists=True, argstr='--warp=%s',
952952
desc='file containing warp field')
953953
abswarp = traits.Bool(argstr='--abs', xor=['relwarp'],
954954
desc="treat warp field as absolute: x' = w(x)")
955-
relwarp = traits.Bool(argstr='--rel', xor=['abswarp'],
955+
relwarp = traits.Bool(argstr='--rel', xor=['abswarp'], position=-1,
956956
desc="treat warp field as relative: x' = x + w(x)")
957957
datatype = traits.Enum('char', 'short', 'int', 'float', 'double',
958958
argstr='--datatype=%s',
@@ -969,7 +969,7 @@ class ApplyWarpInputSpec(FSLCommandInputSpec):
969969
mask_file = File(exists=True, argstr='--mask=%s',
970970
desc='filename for mask image (in reference space)')
971971
interp = traits.Enum(
972-
'nn', 'trilinear', 'sinc', 'spline', argstr='--interp=%s',
972+
'nn', 'trilinear', 'sinc', 'spline', argstr='--interp=%s', position=-2,
973973
desc='interpolation method')
974974

975975

nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ def test_ApplyWarp_inputs():
2020
),
2121
in_file=dict(argstr='--in=%s',
2222
mandatory=True,
23+
position=0,
2324
),
2425
interp=dict(argstr='--interp=%s',
26+
position=-2,
2527
),
2628
mask_file=dict(argstr='--mask=%s',
2729
),
2830
out_file=dict(argstr='--out=%s',
2931
genfile=True,
3032
hash_files=False,
33+
position=2,
3134
),
3235
output_type=dict(),
3336
postmat=dict(argstr='--postmat=%s',
@@ -36,8 +39,10 @@ def test_ApplyWarp_inputs():
3639
),
3740
ref_file=dict(argstr='--ref=%s',
3841
mandatory=True,
42+
position=1,
3943
),
4044
relwarp=dict(argstr='--rel',
45+
position=-1,
4146
xor=['abswarp'],
4247
),
4348
superlevel=dict(argstr='--superlevel=%s',

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -455,17 +455,17 @@ def test_applywarp():
455455
field_file = reffile,
456456
**{name : settings[1]})
457457
if name == 'out_file':
458-
realcmd = 'applywarp --warp=%s '\
459-
'--in=%s --out=%s '\
460-
'--ref=%s'%(reffile, infile,
458+
realcmd = 'applywarp --in=%s '\
459+
'--ref=%s --out=%s '\
460+
'--warp=%s'%(infile, reffile,
461461
settings[1],reffile)
462462
else:
463463
outfile = awarp._gen_fname(infile, suffix='_warp')
464-
realcmd = 'applywarp --warp=%s '\
465-
'--in=%s --out=%s '\
466-
'%s --ref=%s'%(reffile, infile,
467-
outfile, settings[0],
468-
reffile)
464+
realcmd = 'applywarp --in=%s '\
465+
'--ref=%s --out=%s '\
466+
'--warp=%s %s'%(infile, reffile,
467+
outfile, reffile,
468+
settings[0])
469469
yield assert_equal, awarp.cmdline, realcmd
470470

471471
awarp = fsl.ApplyWarp(in_file = infile,

0 commit comments

Comments
 (0)