Skip to content

Commit 05ca44e

Browse files
committed
Fixing condition in _copyheader_update of ANTs's ImageMath interface
1 parent e45ed63 commit 05ca44e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

nipype/interfaces/ants/tests/test_auto_ImageMath.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ def test_ImageMath_inputs():
66
input_map = dict(
77
args=dict(
88
argstr="%s",
9+
position=-1,
910
),
1011
copy_header=dict(
1112
usedefault=True,
@@ -27,11 +28,11 @@ def test_ImageMath_inputs():
2728
argstr="%s",
2829
extensions=None,
2930
mandatory=True,
30-
position=-2,
31+
position=-3,
3132
),
3233
op2=dict(
3334
argstr="%s",
34-
position=-1,
35+
position=-2,
3536
),
3637
operation=dict(
3738
argstr="%s",

nipype/interfaces/ants/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ def _operation_update(self):
208208
self.inputs.copy_header = False
209209

210210
def _copyheader_update(self):
211-
if self.inputs.copy_header and self._no_copy_header_operation:
211+
if (
212+
self.inputs.copy_header
213+
and self.inputs.operation in self._no_copy_header_operation
214+
):
212215
warn(
213216
f"copy_header cannot be updated to True with {self.inputs.operation} as operation."
214217
)

0 commit comments

Comments
 (0)