code: def test_lowlevel_params():
      runs = [IM, IM]
      R = SpaceTimeRealign(
          runs, tr=21, slice_times="ascending", slice_info=1
      )
      borders = (3, 2, 1)
      R.estimate(
          refscan=None,
          loops=1,
          between_loops=1,
          optimizer="steepest",
          borders=borders,
      )
      # Test tighter borders for motion estimation
      r = Realign4dAlgorithm(R._runs[0], borders=borders)
      nvoxels = np.prod(
          np.array(
              [
                  reduced_dim(IM.shape[i], 1, borders[i])
                  for i in range(3)
              ]
          )
      )
      assert_array_equal(r.xyz.shape, (nvoxels, 3))
      # Test wrong argument types raise errors
      pytest.raises(
          ValueError,
          Realign4dAlgorithm,
          R._runs[0],
          subsampling=(3, 3, 3, 1),
      )
      pytest.raises(
          ValueError, Realign4dAlgorithm, R._runs[0], refscan="first"
      )
      pytest.raises(
          ValueError,
          Realign4dAlgorithm,
          R._runs[0],
          borders=(1, 1, 1, 0),
      )
      pytest.raises(
          ValueError, Realign4dAlgorithm, R._runs[0], xtol=None
      )
      pytest.raises(
          ValueError, Realign4dAlgorithm, R._runs[0], ftol="dunno"
      )
      pytest.raises(
          ValueError,
          Realign4dAlgorithm,
          R._runs[0],
          gtol=(0.1, 0.1, 0.1),
      )
      pytest.raises(
          ValueError, Realign4dAlgorithm, R._runs[0], stepsize=None
      )
      pytest.raises(
          ValueError, Realign4dAlgorithm, R._runs[0], maxiter=None
      )
      pytest.raises(
          ValueError, Realign4dAlgorithm, R._runs[0], maxfun="none"
      )
  
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 17 for calling a global function with example usage: test_lowlevel_params() without return types