From 0c1a4cdcf2867523c6dac84ab2ca0745ca5f0d08 Mon Sep 17 00:00:00 2001 From: Lucinda Sisk Date: Tue, 6 Aug 2019 13:49:59 -0400 Subject: [PATCH 1/5] Update reconst.py Change max_sh to InputMultiObject, so that one can pass a list of lmax values when using a multishell model. --- nipype/interfaces/mrtrix3/reconst.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index f1e9c604d2..93d6b26aac 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -6,7 +6,7 @@ import os.path as op -from ..base import traits, TraitedSpec, File, Undefined +from ..base import traits, TraitedSpec, File, Undefined, InputMultiObject from .base import MRTrix3BaseInputSpec, MRTrix3Base @@ -115,10 +115,14 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec): sep=',', argstr='-shell %s', desc='specify one or more dw gradient shells') - max_sh = traits.Int( - 8, usedefault=True, - argstr='-lmax %d', - desc='maximum harmonic degree of response function') + max_sh = InputMultiObject( + traits.Int, + value=[8], + usedefault=True, + argstr='-lmax %s', + sep=',', + desc=('maximum harmonic degree of response function - single value for ' + 'single-shell response, list for multi-shell response')) in_dirs = File( exists=True, argstr='-directions %s', From 26bf3af2086a9e98b7d087013f7d165b08da801b Mon Sep 17 00:00:00 2001 From: Lucinda Sisk Date: Tue, 13 Aug 2019 12:27:46 -0400 Subject: [PATCH 2/5] Revert argstr to use %d --- nipype/interfaces/mrtrix3/reconst.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index 93d6b26aac..9b42f1bbcd 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -119,10 +119,9 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec): traits.Int, value=[8], usedefault=True, - argstr='-lmax %s', + argstr='-lmax %d', sep=',', - desc=('maximum harmonic degree of response function - single value for ' - 'single-shell response, list for multi-shell response')) + desc=('maximum harmonic degree of response function - single value for single-shell response, list for multi-shell response')) in_dirs = File( exists=True, argstr='-directions %s', From 847b42326e14fffe6b708663e28b24fef1025bae Mon Sep 17 00:00:00 2001 From: Lucinda Sisk Date: Fri, 16 Aug 2019 13:01:32 -0400 Subject: [PATCH 3/5] TEST: Update EstimateFOD autotest --- nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py index c64efa2ca4..a935f9aae9 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py @@ -41,8 +41,12 @@ def test_EstimateFOD_inputs(): grad_file=dict( argstr='-grad %s', extensions=None, + xor=['grad_fsl'], + ), + grad_fsl=dict( + argstr='-fslgrad %s %s', + xor=['grad_file'], ), - grad_fsl=dict(argstr='-fslgrad %s %s', ), in_bval=dict(extensions=None, ), in_bvec=dict( argstr='-fslgrad %s %s', @@ -64,6 +68,7 @@ def test_EstimateFOD_inputs(): ), max_sh=dict( argstr='-lmax %d', + sep=',', usedefault=True, ), nthreads=dict( From 4d2d260b8ad4ae6df9eed64847425f3129d75843 Mon Sep 17 00:00:00 2001 From: Lucinda Sisk Date: Fri, 16 Aug 2019 21:40:38 -0400 Subject: [PATCH 4/5] Update nipype/interfaces/mrtrix3/reconst.py - change back to %s Co-Authored-By: Chris Markiewicz --- nipype/interfaces/mrtrix3/reconst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index 9b42f1bbcd..4e2db8de3f 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -119,7 +119,7 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec): traits.Int, value=[8], usedefault=True, - argstr='-lmax %d', + argstr='-lmax %s', sep=',', desc=('maximum harmonic degree of response function - single value for single-shell response, list for multi-shell response')) in_dirs = File( From 3b1b62af7d4da3b944a34f9bbbf755a05d0ff4db Mon Sep 17 00:00:00 2001 From: Lucinda Sisk Date: Fri, 16 Aug 2019 21:41:03 -0400 Subject: [PATCH 5/5] Update nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py Co-Authored-By: Chris Markiewicz --- nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py index a935f9aae9..9f991d51cc 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py @@ -67,7 +67,7 @@ def test_EstimateFOD_inputs(): extensions=None, ), max_sh=dict( - argstr='-lmax %d', + argstr='-lmax %s', sep=',', usedefault=True, ),