From a4d15c1255f792ca59cb21a4df586c30fec146e0 Mon Sep 17 00:00:00 2001 From: econdami Date: Fri, 1 Sep 2023 16:20:15 +0200 Subject: [PATCH 1/2] Fix typo in interfaces/spm/preprocess.py Concerning Normalise12: 1- deformation_file and image_to_align are mutually exclusive. So we can't use the mandatory=True option for these two traits, as one of them will always be Undefined. 2- the self.inputs.jobtype == "estimate" statement is useless because the jobtype trait can only take values in ["est", "write", "estwrite"]. --- nipype/interfaces/spm/preprocess.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 3cc65ce39f..d56d100fab 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -1290,7 +1290,6 @@ class Normalize12InputSpec(SPMCommandInputSpec): field="subj.vol", desc=("file to estimate normalization parameters with"), xor=["deformation_file"], - mandatory=True, copyfile=True, ) apply_to_files = InputMultiPath( @@ -1303,7 +1302,6 @@ class Normalize12InputSpec(SPMCommandInputSpec): ) deformation_file = ImageFileSPM( field="subj.def", - mandatory=True, xor=["image_to_align", "tpm"], copyfile=False, desc=( @@ -1485,13 +1483,7 @@ def _list_outputs(self): outputs["deformation_field"].append(fname_presuffix(imgf, prefix="y_")) outputs["deformation_field"] = simplify_list(outputs["deformation_field"]) - if self.inputs.jobtype == "estimate": - if isdefined(self.inputs.apply_to_files): - outputs["normalized_files"] = self.inputs.apply_to_files - outputs["normalized_image"] = fname_presuffix( - self.inputs.image_to_align, prefix="w" - ) - elif "write" in self.inputs.jobtype: + if "write" in self.inputs.jobtype: outputs["normalized_files"] = [] if isdefined(self.inputs.apply_to_files): filelist = ensure_list(self.inputs.apply_to_files) From 63689e4467fd9e926dc2536fa30577be556bf263 Mon Sep 17 00:00:00 2001 From: econdami Date: Fri, 1 Sep 2023 17:48:41 +0200 Subject: [PATCH 2/2] back to mandatory=True for input features image_to_align and deformation_file in spm process Normalize12 --- nipype/interfaces/spm/preprocess.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index d56d100fab..0b3bfab8fb 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -1290,6 +1290,7 @@ class Normalize12InputSpec(SPMCommandInputSpec): field="subj.vol", desc=("file to estimate normalization parameters with"), xor=["deformation_file"], + mandatory=True, copyfile=True, ) apply_to_files = InputMultiPath( @@ -1302,6 +1303,7 @@ class Normalize12InputSpec(SPMCommandInputSpec): ) deformation_file = ImageFileSPM( field="subj.def", + mandatory=True, xor=["image_to_align", "tpm"], copyfile=False, desc=(