code: def test_realign4d_runs_with_different_affines():
      aff = xyz_affine(IM)
      aff2 = aff.copy()
      aff2[0:3, 3] += 5
      im2 = make_xyz_image(IM.get_fdata(), aff2, "scanner")
      runs = [IM, im2]
      R = SpaceTimeRealign(
          runs, tr=2.0, slice_times="ascending", slice_info=2
      )
      R.estimate(
          refscan=None, loops=1, between_loops=1, optimizer="steepest"
      )
      cor_im, cor_im2 = R.resample()
      assert_array_equal(xyz_affine(cor_im2), aff)
  
imports: import warnings
  import nibabel
  import numpy
  import pytest
  from nibabel import io_orientation
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ....None import load_image
  from ....core.image.image_spaces import make_xyz_image, xyz_affine
  from ....io.nibcompat import get_header
  from ....testing import funcfile
  from ...slicetiming.timefuncs import st_02413, st_42031, st_43210
  from ..affine import Rigid
  from ..groupwise_registration import FmriRealign4d, Image4d, Realign4d, Realign4dAlgorithm, SpaceRealign, SpaceTimeRealign, make_grid, resample4d
label_desc: Use image node_id 13 for calling a global function with example usage: test_realign4d_runs_with_different_affines() without return types