code: def test_nipy_4d_realign(in_tmp_path):
      # Test nipy_4d_realign script
      # Set matplotib agg backend
      with open("matplotlibrc", "w") as fobj:
          fobj.write("backend : agg")
      cmd = [
          "nipy_4d_realign",
          "2.0",
          funcfile,
          "--slice_dim",
          "2",
          "--slice_dir",
          "-1",
          "--save_path",
          ".",
      ]
      run_command(cmd)
  
file_path: nipy/nipy/tests/test_scripts.py
imports: import os
  from os.path import isfile
  from os.path import join
  from unittest import skipIf
  import numpy
  import pytest
  from nibabel.optpkg import optional_package
  from numpy.testing import assert_almost_equal
  from nipy import load_image, save_image
  from nipy.core.api import rollimg
  from nipy.testing.decorators import make_label_dec
  from ..testing import funcfile
  from .scriptrunner import ScriptRunner
label_desc: Use image node_id 4 for calling a global function with example usage: test_nipy_4d_realign(in_tmp_path) without return types