code: def test_write_empty_file(self):
      tractogram = Tractogram(affine_to_rasmm=np.eye(4))
  
      trk_file = BytesIO()
      trk = TrkFile(tractogram)
      trk.save(trk_file)
      trk_file.seek(0, os.SEEK_SET)
  
      new_trk = TrkFile.load(trk_file)
      assert_tractogram_equal(new_trk.tractogram, tractogram)
  
      new_trk_orig = TrkFile.load(DATA["empty_trk_fname"])
      assert_tractogram_equal(
          new_trk.tractogram, new_trk_orig.tractogram
      )
  
      trk_file.seek(0, os.SEEK_SET)
      assert (
          trk_file.read() == open(DATA["empty_trk_fname"], "rb").read()
      )
  
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 9 for calling the TestTRK obj's underlying member method code with example usage: obj.test_write_empty_file() without return types