Skip to content

Commit dc09e00

Browse files
authored
Merge pull request #2529 from oesteban/enh/fslmaths-add-mas
[FIX] Add ``-mas`` argument to fsl.utils.ImageMaths
2 parents d69bfd2 + f74bfc9 commit dc09e00

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

nipype/interfaces/fsl/tests/test_auto_ImageMaths.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,20 @@ def test_ImageMaths_inputs():
2424
argstr='%s',
2525
position=3,
2626
),
27+
mask_file=dict(argstr='-mas %s', ),
2728
op_string=dict(
2829
argstr='%s',
2930
position=2,
3031
),
3132
out_data_type=dict(
3233
argstr='-odt %s',
33-
position=5,
34+
position=-1,
3435
),
3536
out_file=dict(
3637
argstr='%s',
3738
genfile=True,
3839
hash_files=False,
39-
position=4,
40+
position=-2,
4041
),
4142
output_type=dict(),
4243
suffix=dict(),

nipype/interfaces/fsl/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,9 @@ def _list_outputs(self):
500500
class ImageMathsInputSpec(FSLCommandInputSpec):
501501
in_file = File(exists=True, argstr="%s", mandatory=True, position=1)
502502
in_file2 = File(exists=True, argstr="%s", position=3)
503-
out_file = File(argstr="%s", position=4, genfile=True, hash_files=False)
503+
mask_file = File(exists=True, argstr='-mas %s',
504+
desc='use (following image>0) to mask current image')
505+
out_file = File(argstr="%s", position=-2, genfile=True, hash_files=False)
504506
op_string = traits.Str(
505507
argstr="%s",
506508
position=2,
@@ -514,7 +516,7 @@ class ImageMathsInputSpec(FSLCommandInputSpec):
514516
'double',
515517
'input',
516518
argstr="-odt %s",
517-
position=5,
519+
position=-1,
518520
desc=("output datatype, one of (char, short, "
519521
"int, float, double, input)"))
520522

0 commit comments

Comments
 (0)