code: def _read_dig_kit(fname, unit="auto"):
      # Read dig points from a file and return ndarray, using FastSCAN for .txt
      fname = _check_fname(
          fname, "read", must_exist=True, name="hsp or elp file"
      )
      assert unit in ("auto", "m", "mm")
      _check_option(
          "file extension",
          fname.suffix,
          (".hsp", ".elp", ".mat", ".txt"),
      )
      if fname.suffix == ".txt":
          unit = "mm" if unit == "auto" else unit
          out = read_polhemus_fastscan(
              fname, unit=unit, on_header_missing="ignore"
          )
      elif fname.suffix in (".hsp", ".elp"):
          unit = "m" if unit == "auto" else unit
          mon = read_dig_polhemus_isotrak(fname, unit=unit)
          if fname.suffix == ".hsp":
              dig = [
                  d["r"]
                  for d in mon.dig
                  if d["kind"] != FIFF.FIFFV_POINT_CARDINAL
              ]
          else:
              dig = [d["r"] for d in mon.dig]
              if (
                  dig
                  and mon.dig[0]["kind"] == FIFF.FIFFV_POINT_CARDINAL
                  and mon.dig[0]["ident"] == FIFF.FIFFV_POINT_LPA
              ):
                  # LPA, Nasion, RPA -> NLR
                  dig[:3] = [dig[1], dig[0], dig[2]]
          out = np.array(dig, float)
      else:
          assert fname.suffix == ".mat"
          out = np.array(
              [d["r"] for d in read_custom_montage(fname).dig]
          )
      _check_dig_shape(out)
      return out
  
file_path: mne-python/mne/io/kit/coreg.py
imports: import pickle
  import re
  from collections import OrderedDict
  from os import SEEK_CUR, PathLike
  from pathlib import Path
  import numpy
  from ..._fiff._digitization import _make_dig_points
  from ...channels.montage import _check_dig_shape, read_custom_montage, read_dig_polhemus_isotrak, read_polhemus_fastscan
  from ...transforms import Transform, als_ras_trans, apply_trans, get_ras_to_neuromag_trans
  from ...utils import _check_fname, _check_option, warn
  from .constants import FIFF, KIT
label_desc: Use image node_id 4 for calling a global function with example usage: _read_dig_kit(fname, unit) and returns: out