Skip to content

Commit 5e560d9

Browse files
authored
ENH: Add "TruncateImageIntensity" operation to ants.utils.ImageMath
``"TruncateImageIntensity"`` is part of ``antsBrainExtraction.sh`` and therefore, having it supported by nipype is of great interest. This PR addresses a problem @eilidhmacnicol just discovered. Having this merged will also allow us to call the upstreaming of ANTS interfaces from niworkflows done.
1 parent 9a7db4d commit 5e560d9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nipype/interfaces/ants/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class ImageMathInputSpec(ANTSCommandInputSpec):
4646
"GE",
4747
"GO",
4848
"GC",
49+
"TruncateImageIntensity",
4950
mandatory=True,
5051
position=3,
5152
argstr="%s",
@@ -92,6 +93,12 @@ class ImageMath(ANTSCommand, CopyHeaderInterface):
9293
... op2='4').cmdline
9394
'ImageMath 3 structural_maths.nii G structural.nii 4'
9495
96+
>>> ImageMath(
97+
... op1='structural.nii',
98+
... operation='TruncateImageIntensity',
99+
... op2='0.005 0.999 256').cmdline
100+
'ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256'
101+
95102
"""
96103

97104
_cmd = "ImageMath"

0 commit comments

Comments
 (0)