code: def is_header_compatible(reference_1, reference_2):
      """Will compare the spatial attribute of 2 references
  
      Parameters
      ----------
      reference_1 : Nifti or Trk filename, Nifti1Image or TrkFile,
          Nifti1Header or trk.header (dict)
          Reference that provides the spatial attribute.
      reference_2 : Nifti or Trk filename, Nifti1Image or TrkFile,
          Nifti1Header or trk.header (dict)
          Reference that provides the spatial attribute.
  
      Returns
      -------
      output : bool
          Does all the spatial attribute match
      """
  
      (
          affine_1,
          dimensions_1,
          voxel_sizes_1,
          voxel_order_1,
      ) = get_reference_info(reference_1)
      (
          affine_2,
          dimensions_2,
          voxel_sizes_2,
          voxel_order_2,
      ) = get_reference_info(reference_2)
  
      identical_header = True
      if not np.allclose(affine_1, affine_2, rtol=1e-03, atol=1e-03):
          logging.error("Affine not equal")
          identical_header = False
  
      if not np.array_equal(dimensions_1, dimensions_2):
          logging.error("Dimensions not equal")
          identical_header = False
  
      if not np.allclose(
          voxel_sizes_1, voxel_sizes_2, rtol=1e-03, atol=1e-03
      ):
          logging.error("Voxel_size not equal")
          identical_header = False
  
      if voxel_order_1 != voxel_order_2:
          logging.error("Voxel_order not equal")
          identical_header = False
  
      return identical_header
  
imports: import logging
  import numbers
  import os
  from dipy.utils.optpkg import optional_package
  import dipy
  import nibabel
  from nibabel.streamlines import detect_format
  from nibabel import Nifti1Image
  import numpy
  from trx import trx_file_memmap
label_desc: Use image node_id 8 for calling a global function with example usage: is_header_compatible(reference_1, reference_2) and returns: identical_header