@@ -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,23 @@ 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``.
107111 >>> pad = ImageMath(
108112 ... op1='structural.nii',
109- ... operation='PadImage',
110- ... op2='0.005 0.999 256')
113+ ... operation='PadImage')
111114 >>> pad.inputs.copy_header
112115 False
113116
117+ >>> # While the operation is set to ``PadImage``,
118+ >>> # setting ``copy_header = True`` will have no effect.
114119 >>> pad.inputs.copy_header = True
115120 >>> pad.inputs.copy_header
116121 False
117122
123+ >>> # For any other operation, ``copy_header`` can be enabled/disabled normally:
118124 >>> pad.inputs.operation = "ME"
119125 >>> pad.inputs.copy_header = True
120126 >>> pad.inputs.copy_header
0 commit comments