if not isinstance(img, nibabel.spatialimages.SpatialImage):
raise ValueError("Input value is not an image")
return new_img_like(img, _safe_get_data(img), img.get_affine().copy(),
copy_header=True)
After Change
if not isinstance(img, nibabel.spatialimages.SpatialImage):
raise ValueError("Input value is not an image")
return new_img_like(img, _safe_get_data(img).copy(), img.get_affine().copy(),
copy_header=True)