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.
to_img
1 parent 07fa254 commit 00825c7Copy full SHA for 00825c7
nibabel/processing.py
@@ -374,11 +374,11 @@ def conform(from_img,
374
raise ValueError("`voxel_size` must have {} values".format(required_ndim))
375
376
# Create fake image of the image we want to resample to.
377
- hdr = Nifti1Header()
+ hdr = from_img.header_class()
378
hdr.set_data_shape(out_shape)
379
hdr.set_zooms(voxel_size)
380
dst_aff = hdr.get_best_affine()
381
- to_img = Nifti1Image(np.empty(out_shape), affine=dst_aff, header=hdr)
+ to_img = from_img.__class__(np.empty(out_shape), affine=dst_aff, header=hdr)
382
383
# Resample input image.
384
out_img = resample_from_to(
0 commit comments