code: def test_nipy_3_4d(in_tmp_path):
      # Test nipy_3dto4d and nipy_4dto3d
      fimg = load_image(funcfile)
      N = fimg.shape[-1]
      out_4d = "func4d.nii"
      cmd = ["nipy_4dto3d", funcfile, "--out-path=" + str(in_tmp_path)]
      run_command(cmd)
      imgs_3d = ["functional_%04d.nii" % i for i in range(N)]
      for iname in imgs_3d:
          assert isfile(iname)
      cmd = ["nipy_3dto4d"] + imgs_3d + ["--out-4d=" + out_4d]
      run_command(cmd)
      fimg_back = load_image(out_4d)
      assert_almost_equal(fimg.get_fdata(), fimg_back.get_fdata())
      del fimg_back
  
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 3 for calling a global function with example usage: test_nipy_3_4d(in_tmp_path) without return types