Skip to content

Commit a4d15c1

Browse files
committed
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"].
1 parent 03a2363 commit a4d15c1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

nipype/interfaces/spm/preprocess.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,6 @@ class Normalize12InputSpec(SPMCommandInputSpec):
12901290
field="subj.vol",
12911291
desc=("file to estimate normalization parameters with"),
12921292
xor=["deformation_file"],
1293-
mandatory=True,
12941293
copyfile=True,
12951294
)
12961295
apply_to_files = InputMultiPath(
@@ -1303,7 +1302,6 @@ class Normalize12InputSpec(SPMCommandInputSpec):
13031302
)
13041303
deformation_file = ImageFileSPM(
13051304
field="subj.def",
1306-
mandatory=True,
13071305
xor=["image_to_align", "tpm"],
13081306
copyfile=False,
13091307
desc=(
@@ -1485,13 +1483,7 @@ def _list_outputs(self):
14851483
outputs["deformation_field"].append(fname_presuffix(imgf, prefix="y_"))
14861484
outputs["deformation_field"] = simplify_list(outputs["deformation_field"])
14871485

1488-
if self.inputs.jobtype == "estimate":
1489-
if isdefined(self.inputs.apply_to_files):
1490-
outputs["normalized_files"] = self.inputs.apply_to_files
1491-
outputs["normalized_image"] = fname_presuffix(
1492-
self.inputs.image_to_align, prefix="w"
1493-
)
1494-
elif "write" in self.inputs.jobtype:
1486+
if "write" in self.inputs.jobtype:
14951487
outputs["normalized_files"] = []
14961488
if isdefined(self.inputs.apply_to_files):
14971489
filelist = ensure_list(self.inputs.apply_to_files)

0 commit comments

Comments
 (0)