@@ -78,8 +78,8 @@ class ImageMath(ANTSCommand, CopyHeaderInterface):
7878 """
7979 Operations over images.
8080
81- Example
82- -------
81+ Examples
82+ --------
8383 >>> ImageMath(
8484 ... op1='structural.nii',
8585 ... operation='+',
@@ -104,17 +104,26 @@ 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+ By default, Nipype copies headers from the first input image (``op1``)
108+ to the output image.
109+ For the ``PadImage`` operation, the header cannot be copied from inputs to
110+ outputs, and so ``copy_header`` option is automatically set to ``False``.
111+
107112 >>> pad = ImageMath(
108113 ... op1='structural.nii',
109- ... operation='PadImage',
110- ... op2='0.005 0.999 256')
114+ ... operation='PadImage')
111115 >>> pad.inputs.copy_header
112116 False
113117
118+ While the operation is set to ``PadImage``,
119+ setting ``copy_header = True`` will have no effect.
120+
114121 >>> pad.inputs.copy_header = True
115122 >>> pad.inputs.copy_header
116123 False
117124
125+ For any other operation, ``copy_header`` can be enabled/disabled normally:
126+
118127 >>> pad.inputs.operation = "ME"
119128 >>> pad.inputs.copy_header = True
120129 >>> pad.inputs.copy_header
0 commit comments