code: def _read_head_shape(fname):
      """Read the head shape."""
      with _bti_open(fname, "rb") as fid:
          fid.seek(BTI.FILE_HS_N_DIGPOINTS)
          _n_dig_points = read_int32(fid)
          idx_points = read_double_matrix(fid, BTI.DATA_N_IDX_POINTS, 3)
          dig_points = read_double_matrix(fid, _n_dig_points, 3)
  
      # reorder to lpa, rpa, nasion so = is direct.
      nasion, lpa, rpa = (idx_points[_, :] for _ in [2, 0, 1])
      hpi = idx_points[3 : len(idx_points), :]
  
      return nasion, lpa, rpa, hpi, dig_points
  
imports: import functools
  import os.path
  from io import BytesIO
  from itertools import count
  import numpy
  from ..._fiff._digitization import _make_bti_dig_points
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info
  from ..._fiff.tag import _coil_trans_to_loc, _loc_to_coil_trans
  from ..._fiff.utils import _mult_cal_one, read_str
  from ...transforms import Transform, combine_transforms, invert_transform
  from ...utils import _stamp_to_dt, _validate_type, logger, path_like, verbose
  from ..base import BaseRaw
  from .constants import BTI
  from .read import read_char, read_dev_header, read_double, read_double_matrix, read_float, read_float_matrix, read_int16, read_int16_matrix, read_int32, read_int64, read_transform, read_uint16, read_uint32
label_desc: Use image node_id 5 for calling a global function with example usage: _read_head_shape(fname) and returns: nasion,  lpa,  rpa,  hpi,  dig_points