From d9bda43fdc0482c8fab504ff4fef71d10acd3522 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 14 Apr 2021 14:16:27 +0200 Subject: [PATCH 1/4] coorected field -> out{1}.pull for in_files and interpolation --- nipype/interfaces/spm/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 74355f6b3f..fe34e659fc 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -262,12 +262,13 @@ class ApplyInverseDeformationInput(SPMCommandInputSpec): in_files = InputMultiPath( File(exists=True), mandatory=True, - field="fnames", + field="out{1}.pull.fnames", desc="Files on which deformation is applied", ) target = File( exists=True, field="comp{1}.inv.space", desc="File defining target space" ) + deformation = File( exists=True, field="comp{1}.inv.comp{1}.sn2def.matname", @@ -281,7 +282,7 @@ class ApplyInverseDeformationInput(SPMCommandInputSpec): xor=["deformation"], ) interpolation = traits.Range( - low=0, high=7, field="interp", desc="degree of b-spline used for interpolation" + low=0, high=7, field="out{1}.pull.interp", desc="degree of b-spline used for interpolation" ) bounding_box = traits.List( From 651086312a54f60487e4cbba99a302b172acfcaa Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 14 Apr 2021 16:40:12 +0200 Subject: [PATCH 2/4] modified the formating of inputs (reference has to be one image for sure, but the in_files can be a list as well) --- nipype/interfaces/spm/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index fe34e659fc..9dd95a1e81 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -329,9 +329,11 @@ class ApplyInverseDeformation(SPMCommand): def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm""" if opt == "in_files": - return scans_for_fnames(ensure_list(val)) + return np.array([simplify_list(val)], dtype=object) + # return scans_for_fnames(ensure_list(val)) if opt == "target": - return scans_for_fname(ensure_list(val)) + return np.array([simplify_list(val)], dtype=object) + # return scans_for_fname(ensure_list(val)) if opt == "deformation": return np.array([simplify_list(val)], dtype=object) if opt == "deformation_field": From ab42259cc4c8f17ede2fae43cd36c9c8a0171993 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Fri, 30 Apr 2021 17:47:18 -0400 Subject: [PATCH 3/4] STY: black --- nipype/interfaces/spm/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 515758cfe3..0b18e34a79 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -282,7 +282,10 @@ class ApplyInverseDeformationInput(SPMCommandInputSpec): xor=["deformation"], ) interpolation = traits.Range( - low=0, high=7, field="out{1}.pull.interp", desc="degree of b-spline used for interpolation" + low=0, + high=7, + field="out{1}.pull.interp", + desc="degree of b-spline used for interpolation", ) bounding_box = traits.List( From 527699c7841314d9084362d564ce0e80714c2bfe Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Fri, 30 Apr 2021 17:47:28 -0400 Subject: [PATCH 4/4] TEST: make specs --- .../interfaces/spm/tests/test_auto_ApplyInverseDeformation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py b/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py index c652bd7e12..5ebc80e804 100644 --- a/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py +++ b/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py @@ -18,11 +18,11 @@ def test_ApplyInverseDeformation_inputs(): xor=["deformation"], ), in_files=dict( - field="fnames", + field="out{1}.pull.fnames", mandatory=True, ), interpolation=dict( - field="interp", + field="out{1}.pull.interp", ), matlab_cmd=dict(), mfile=dict(