code: def _get_affine_from_lta_info(lines):
      """Get the vox2ras affine from lta file info."""
      volume_data = np.loadtxt([line.split("=")[1] for line in lines])
      # get the size of the volume (number of voxels), slice resolution.
      # the matrix of directional cosines and the ras at the center of the bore
      dims, deltas, dir_cos, center_ras = (
          volume_data[0],
          volume_data[1],
          volume_data[2:5],
          volume_data[5],
      )
      dir_cos_delta = dir_cos.T * deltas
      vol_center = (dir_cos_delta @ dims[:3]) / 2
      affine = np.eye(4)
      affine[:3, :3] = dir_cos_delta
      affine[:3, 3] = center_ras - vol_center
      return affine
  
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 15 for calling a global function with example usage: _get_affine_from_lta_info(lines) and returns: affine