@@ -78,8 +78,8 @@ class ImageMath(ANTSCommand, CopyHeaderInterface):
78
78
"""
79
79
Operations over images.
80
80
81
- Example
82
- -------
81
+ Examples
82
+ --------
83
83
>>> ImageMath(
84
84
... op1='structural.nii',
85
85
... operation='+',
@@ -104,17 +104,26 @@ class ImageMath(ANTSCommand, CopyHeaderInterface):
104
104
... op2='0.005 0.999 256').cmdline
105
105
'ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256'
106
106
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
+
107
112
>>> pad = ImageMath(
108
113
... op1='structural.nii',
109
- ... operation='PadImage',
110
- ... op2='0.005 0.999 256')
114
+ ... operation='PadImage')
111
115
>>> pad.inputs.copy_header
112
116
False
113
117
118
+ While the operation is set to ``PadImage``,
119
+ setting ``copy_header = True`` will have no effect.
120
+
114
121
>>> pad.inputs.copy_header = True
115
122
>>> pad.inputs.copy_header
116
123
False
117
124
125
+ For any other operation, ``copy_header`` can be enabled/disabled normally:
126
+
118
127
>>> pad.inputs.operation = "ME"
119
128
>>> pad.inputs.copy_header = True
120
129
>>> pad.inputs.copy_header
0 commit comments