Skip to content

Commit

Permalink
Fix typo in interfaces/spm/preprocess.py
Browse files Browse the repository at this point in the history
	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"].
  • Loading branch information
servoz committed Sep 1, 2023
1 parent 03a2363 commit a4d15c1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions nipype/interfaces/spm/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -1303,7 +1302,6 @@ class Normalize12InputSpec(SPMCommandInputSpec):
)
deformation_file = ImageFileSPM(
field="subj.def",
mandatory=True,
xor=["image_to_align", "tpm"],
copyfile=False,
desc=(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a4d15c1

Please sign in to comment.