def METHOD_NAME(tmp_path, fields, slope, inter):
    fname = str(tmp_path / "test_file.nii")
    # Generate file
    init_img = random_image()
    init_img.header.set_slope_inter(slope, inter)
    init_img.to_filename(fname)
    # Reference load
    pre_img = nb.load(fname, mmap=False)
    pre_data = pre_img.get_fdata()
    update_header_fields(fname, **fields)
    # Post-rewrite load
    post_img = nb.load(fname)
    # Data should be identical
    assert np.array_equal(pre_data, post_img.get_fdata())