From 5e560d9befe70b369b25c2f6eb42cefc1dc37579 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 27 Apr 2020 08:44:54 -0700 Subject: [PATCH] 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. --- nipype/interfaces/ants/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 6c3c05e9c4..a158aa83d4 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -46,6 +46,7 @@ class ImageMathInputSpec(ANTSCommandInputSpec): "GE", "GO", "GC", + "TruncateImageIntensity", mandatory=True, position=3, argstr="%s", @@ -92,6 +93,12 @@ class ImageMath(ANTSCommand, CopyHeaderInterface): ... op2='4').cmdline 'ImageMath 3 structural_maths.nii G structural.nii 4' + >>> ImageMath( + ... op1='structural.nii', + ... operation='TruncateImageIntensity', + ... op2='0.005 0.999 256').cmdline + 'ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256' + """ _cmd = "ImageMath"