code: def test_mgz_header():
      """Test MGZ header reading."""
      nib = pytest.importorskip("nibabel")
      header = _get_mgz_header(fname_mri)
      mri_hdr = nib.load(fname_mri).header
      assert_allclose(mri_hdr.get_data_shape(), header["dims"])
      assert_allclose(mri_hdr.get_vox2ras_tkr(), header["vox2ras_tkr"])
      assert_allclose(
          mri_hdr.get_ras2vox(), np.linalg.inv(header["vox2ras"])
      )
  
file_path: mne-python/mne/tests/test_freesurfer.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  import mne
  from mne import get_volume_labels_from_aseg, head_to_mni, read_freesurfer_lut, read_talxfm, vertex_to_mni
  from mne._freesurfer import _check_subject_dir, _estimate_talxfm_rigid, _get_mgz_header, read_lta
  from mne.datasets import testing
  from mne.transforms import _angle_between_quats, _get_trans, apply_trans, rot_to_quat
label_desc: Use image node_id 2 for calling a global function with example usage: test_mgz_header() without return types