Skip to content

Commit 1d95223

Browse files
committed
doc: add explanation to doctests [skip ci]
1 parent e59aaa6 commit 1d95223

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nipype/interfaces/ants/utils.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,21 @@ class ImageMath(ANTSCommand, CopyHeaderInterface):
104104
... op2='0.005 0.999 256').cmdline
105105
'ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256'
106106
107+
>>> # Test the special case of PadImage. In this case, copy_header is disabled
108+
>>> # because the header cannot be copied from inputs to ouptuts.
109+
>>> # When operation is PadImage, the copy_header is set to False automatically:
107110
>>> pad = ImageMath(
108111
... op1='structural.nii',
109-
... operation='PadImage',
110-
... op2='0.005 0.999 256')
112+
... operation='PadImage')
111113
>>> pad.inputs.copy_header
112114
False
113115
116+
>>> # While operation remains as PadImage, copy_header will not accept True
114117
>>> pad.inputs.copy_header = True
115118
>>> pad.inputs.copy_header
116119
False
117120
121+
>>> # For any other operation, copy_header gets its default behavior back.
118122
>>> pad.inputs.operation = "ME"
119123
>>> pad.inputs.copy_header = True
120124
>>> pad.inputs.copy_header

0 commit comments

Comments
 (0)