File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments