def test_new_img_like_side_effect(): img1 = Nifti1Image(np.ones((2, 2, 2, 2)), affine=np.eye(4)) hash1 = joblib.hash(img1) new_img_like(img1, np.ones((2, 2, 2, 2)), img1.affine.copy(), copy_header=True) hash2 = joblib.hash(img1) assert hash1 == hash2
def test_copy_img_side_effect(): img1 = Nifti1Image(np.ones((2, 2, 2, 2)), affine=np.eye(4)) hash1 = joblib.hash(img1) niimg.copy_img(img1) hash2 = joblib.hash(img1) assert hash1 == hash2