code: def test_dim_info():
      # Test slice, freq, phase get set OK
      fimg = copy_of(funcfile)
      hdr = fimg.metadata["header"]
      assert hdr.get_dim_info() == (None, None, None)
      ni_img = nipy2nifti(fimg)
      assert get_header(ni_img).get_dim_info() == (None, None, None)
      data = fimg.get_fdata()
      cmap = fimg.coordmap
      for i in range(3):
          for order, name in enumerate(("freq", "phase", "slice")):
              ncmap = cmap.renamed_domain({i: name})
              ni_img = nipy2nifti(Image(data, ncmap, {"header": hdr}))
              exp_info = [None, None, None]
              exp_info[order] = i
              assert get_header(ni_img).get_dim_info() == tuple(
                  exp_info
              )
      ncmap = cmap.renamed_domain(
          dict(zip(range(3), ("phase", "slice", "freq")))
      )
      ni_img = nipy2nifti(Image(data, ncmap, {"header": hdr}))
      assert get_header(ni_img).get_dim_info() == (2, 0, 1)
  
imports: import warnings
  from copy import copy
  import nibabel
  import numpy
  import pytest
  from nibabel.affines import from_matvec
  from nibabel.spatialimages import HeaderDataError
  from numpy.testing import assert_array_equal
  from ...core.api import AffineTransform
  from ...core.api import CoordinateSystem
  from ...core.api import Image
  from ...core.reference.spaces import aligned_csm, mni_csm, scanner_csm, talairach_csm, unknown_csm, unknown_space, vox2mni
  from ...testing import anatfile, funcfile
  from ..files import load
  from ..nibcompat import get_affine, get_header
  from ..nifti_ref import NiftiError, nifti2nipy, nipy2nifti
label_desc: Use image node_id 6 for calling a global function with example usage: test_dim_info() without return types