code: def test_load_file_with_wrong_information(self):
      # Simulate a TRK file where `voxel_order` is lowercase.
      trk_struct1, trk_bytes1 = self.trk_with_bytes()
      trk_struct1[Field.VOXEL_ORDER] = b"LAS"
      trk1 = TrkFile.load(BytesIO(trk_bytes1))
      trk_struct2, trk_bytes2 = self.trk_with_bytes()
      trk_struct2[Field.VOXEL_ORDER] = b"las"
      trk2 = TrkFile.load(BytesIO(trk_bytes2))
      trk1_aff2rasmm = get_affine_trackvis_to_rasmm(trk1.header)
      trk2_aff2rasmm = get_affine_trackvis_to_rasmm(trk2.header)
      assert_array_equal(trk1_aff2rasmm, trk2_aff2rasmm)
  
      # Simulate a TRK file where `count` was not provided.
      trk_struct, trk_bytes = self.trk_with_bytes()
      trk_struct[Field.NB_STREAMLINES] = 0
      trk = TrkFile.load(BytesIO(trk_bytes), lazy_load=False)
      assert_tractogram_equal(trk.tractogram, DATA["simple_tractogram"])
  
      # Simulate a TRK where `vox_to_ras` is not recorded (i.e. all zeros).
      trk_struct, trk_bytes = self.trk_with_bytes()
      trk_struct[Field.VOXEL_TO_RASMM] = np.zeros((4, 4))
      with pytest.warns(HeaderWarning, match="identity"):
          trk = TrkFile.load(BytesIO(trk_bytes))
      assert_array_equal(trk.affine, np.eye(4))
  
      # Simulate a TRK where `vox_to_ras` is invalid.
      trk_struct, trk_bytes = self.trk_with_bytes()
      trk_struct[Field.VOXEL_TO_RASMM] = np.diag([0, 0, 0, 1])
      with clear_and_catch_warnings(
          record=True, modules=[trk_module]
      ) as w:
          with pytest.raises(HeaderError):
              TrkFile.load(BytesIO(trk_bytes))
  
      # Simulate a TRK file where `voxel_order` was not provided.
      trk_struct, trk_bytes = self.trk_with_bytes()
      trk_struct[Field.VOXEL_ORDER] = b""
      with pytest.warns(HeaderWarning, match="LPS"):
          TrkFile.load(BytesIO(trk_bytes))
  
      # Simulate a TRK file with an unsupported version.
      trk_struct, trk_bytes = self.trk_with_bytes()
      trk_struct["version"] = 123
      with pytest.raises(HeaderError):
          TrkFile.load(BytesIO(trk_bytes))
  
      # Simulate a TRK file with a wrong hdr_size.
      trk_struct, trk_bytes = self.trk_with_bytes()
      trk_struct["hdr_size"] = 1234
      with pytest.raises(HeaderError):
          TrkFile.load(BytesIO(trk_bytes))
  
      # Simulate a TRK file with a wrong scalar_name.
      trk_struct, trk_bytes = self.trk_with_bytes("complex_trk_fname")
      trk_struct["scalar_name"][0, 0] = b"colors\x003\x004"
      with pytest.raises(HeaderError):
          TrkFile.load(BytesIO(trk_bytes))
  
      # Simulate a TRK file with a wrong property_name.
      trk_struct, trk_bytes = self.trk_with_bytes("complex_trk_fname")
      trk_struct["property_name"][0, 0] = b"colors\x003\x004"
      with pytest.raises(HeaderError):
          TrkFile.load(BytesIO(trk_bytes))
  
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 5 for calling the TestTRK obj's underlying member method code with example usage: obj.test_load_file_with_wrong_information() without return types