We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79e5cad commit e0bde09Copy full SHA for e0bde09
nitransforms/resampling.py
@@ -189,10 +189,9 @@ def apply(
189
)
190
191
if isinstance(_ref, ImageGrid): # If reference is grid, reshape
192
- hdr = None
193
- if _ref.header is not None:
194
- hdr = _ref.header.copy()
195
- hdr.set_data_dtype(output_dtype or spatialimage.get_data_dtype())
+ hdr = _ref.header.copy() if _ref.header is not None else spatialimage.header.__class__()
+ hdr.set_data_dtype(output_dtype)
+
196
moved = spatialimage.__class__(
197
resampled.reshape(_ref.shape if data.ndim < 4 else _ref.shape + (-1,)),
198
_ref.affine,
0 commit comments