code: def _read_mri_info(
      path, units="m", return_img=False, use_nibabel=False
  ):
      # This is equivalent but 100x slower, so only use nibabel if we need to
      # (later):
      if use_nibabel:
          nib = _import_nibabel()
          hdr = nib.load(path).header
          n_orig = hdr.get_vox2ras()
          t_orig = hdr.get_vox2ras_tkr()
          dims = hdr.get_data_shape()
          zooms = hdr.get_zooms()[:3]
      else:
          hdr = _get_mgz_header(path)
          n_orig = hdr["vox2ras"]
          t_orig = hdr["vox2ras_tkr"]
          dims = hdr["dims"]
          zooms = hdr["zooms"]
  
      # extract the MRI_VOXEL to RAS (non-zero origin) transform
      vox_ras_t = Transform("mri_voxel", "ras", n_orig)
  
      # extract the MRI_VOXEL to MRI transform
      vox_mri_t = Transform("mri_voxel", "mri", t_orig)
  
      # construct the MRI to RAS (non-zero origin) transform
      mri_ras_t = combine_transforms(
          invert_transform(vox_mri_t), vox_ras_t, "mri", "ras"
      )
  
      assert units in ("m", "mm")
      if units == "m":
          conv = np.array([[1e-3, 1e-3, 1e-3, 1]]).T
          # scaling and translation terms
          vox_ras_t["trans"] *= conv
          vox_mri_t["trans"] *= conv
          # just the translation term
          mri_ras_t["trans"][:, 3:4] *= conv
  
      out = (vox_ras_t, vox_mri_t, mri_ras_t, dims, zooms)
      if return_img:
          nibabel = _import_nibabel()
          out += (nibabel.load(path),)
      return out
  
imports: import os.path
  from gzip import GzipFile
  from pathlib import Path
  import numpy
  from ._fiff.constants import FIFF
  from ._fiff.meas_info import read_fiducials
  from .surface import _read_mri_surface, read_surface
  from .transforms import Transform, _ensure_trans, apply_trans, combine_transforms, invert_transform, read_ras_mni_t
  from .utils import _check_fname, _check_option, _import_nibabel, _validate_type, get_subjects_dir, logger, verbose
label_desc: Use image node_id 19 for calling a global function with example usage: _read_mri_info(path, units, return_img, use_nibabel) and returns: out