code: def test_header_read_restore(self):
      # Test that reading a header restores the file position
      trk_fname = DATA["simple_trk_fname"]
      bio = BytesIO()
      bio.write(b"Along my very merry way")
      hdr_pos = bio.tell()
      hdr_from_fname = TrkFile._read_header(trk_fname)
      with open(trk_fname, "rb") as fobj:
          bio.write(fobj.read())
      bio.seek(hdr_pos)
      # Check header is as expected
      hdr_from_fname[
          "_offset_data"
      ] += hdr_pos  # Correct for start position
      assert_arr_dict_equal(TrkFile._read_header(bio), hdr_from_fname)
      # Check fileobject file position has not changed
      assert bio.tell() == hdr_pos
  
imports: import copy
  import os
  import sys
  import unittest
  from io import BytesIO
  from os.path import join
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ...testing import assert_arr_dict_equal, clear_and_catch_warnings, data_path, error_warnings
  from ..None import trk
  from ..header import Field
  from ..tractogram import Tractogram
  from ..tractogram_file import HeaderError, HeaderWarning
  from ..trk import TrkFile, decode_value_from_name, encode_value_in_name, get_affine_trackvis_to_rasmm
  from .test_tractogram import assert_tractogram_equal
label_desc: Use image node_id 18 for calling the TestTRK obj's underlying member method code with example usage: obj.test_header_read_restore() without return types