From 6d4535e4c54aaa81ba4611d8d6a81b791ef363b3 Mon Sep 17 00:00:00 2001 From: Ali Ghayoor Date: Tue, 24 May 2016 10:33:13 -0500 Subject: [PATCH 1/2] ENH: Added allowLossyConversion to DWIConvert input spec --- nipype/interfaces/semtools/diffusion/diffusion.py | 1 + .../interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/nipype/interfaces/semtools/diffusion/diffusion.py b/nipype/interfaces/semtools/diffusion/diffusion.py index 6d30e1fc44..bc2805a9cc 100644 --- a/nipype/interfaces/semtools/diffusion/diffusion.py +++ b/nipype/interfaces/semtools/diffusion/diffusion.py @@ -244,6 +244,7 @@ class DWIConvertInputSpec(CommandLineInputSpec): outputDirectory = traits.Either(traits.Bool, Directory(), hash_files=False, desc="Directory holding the output NRRD file", argstr="--outputDirectory %s") gradientVectorFile = traits.Either(traits.Bool, File(), hash_files=False, desc="Text file giving gradient vectors", argstr="--gradientVectorFile %s") smallGradientThreshold = traits.Float(desc="If a gradient magnitude is greater than 0 and less than smallGradientThreshold, then DWIConvert will display an error message and quit, unless the useBMatrixGradientDirections option is set.", argstr="--smallGradientThreshold %f") + allowLossyConversion = traits.Bool(desc="The only supported output type is \'short\'. Conversion from images of a different type may cause data loss due to rounding or truncation. Use with caution!", argstr="--allowLossyConversion ") class DWIConvertOutputSpec(TraitedSpec): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py index 15e293f3aa..0711532c99 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py @@ -51,6 +51,8 @@ def test_DWIConvert_inputs(): ), writeProtocolGradientsFile=dict(argstr='--writeProtocolGradientsFile ', ), + allowLossyConversion=dict(argstr='--allowLossyConversion ', + ), ) inputs = DWIConvert.input_spec() From e818b64e6cea9f643360ab3ece312a33d08c90ea Mon Sep 17 00:00:00 2001 From: Ali Ghayoor Date: Tue, 24 May 2016 18:08:20 -0500 Subject: [PATCH 2/2] ENH: Added transposeInputBVectors to DWIConvert input spec --- nipype/interfaces/semtools/diffusion/diffusion.py | 1 + .../interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/nipype/interfaces/semtools/diffusion/diffusion.py b/nipype/interfaces/semtools/diffusion/diffusion.py index bc2805a9cc..ffb1e4d280 100644 --- a/nipype/interfaces/semtools/diffusion/diffusion.py +++ b/nipype/interfaces/semtools/diffusion/diffusion.py @@ -245,6 +245,7 @@ class DWIConvertInputSpec(CommandLineInputSpec): gradientVectorFile = traits.Either(traits.Bool, File(), hash_files=False, desc="Text file giving gradient vectors", argstr="--gradientVectorFile %s") smallGradientThreshold = traits.Float(desc="If a gradient magnitude is greater than 0 and less than smallGradientThreshold, then DWIConvert will display an error message and quit, unless the useBMatrixGradientDirections option is set.", argstr="--smallGradientThreshold %f") allowLossyConversion = traits.Bool(desc="The only supported output type is \'short\'. Conversion from images of a different type may cause data loss due to rounding or truncation. Use with caution!", argstr="--allowLossyConversion ") + transposeInputBVectors = traits.Bool(desc="FSL input BVectors are expected to be encoded in the input file as one vector per line. If it is not the case, use this option to transpose the file as it is read.", argstr="--transposeInputBVectors ") class DWIConvertOutputSpec(TraitedSpec): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py index 0711532c99..556f2b09bf 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py @@ -53,6 +53,8 @@ def test_DWIConvert_inputs(): ), allowLossyConversion=dict(argstr='--allowLossyConversion ', ), + transposeInputBVectors=dict(argstr='--transposeInputBVectors ', + ), ) inputs = DWIConvert.input_spec()