code: def compute_orientation(init_axcodes, final_axcodes):
      """
      A thin wrapper around ``nib.orientations.ornt_transform``
  
      :param init_axcodes: Initial orientation codes
      :param final_axcodes: Target orientation codes
      :return: orientations array, start_ornt, end_ornt
      """
      ornt_init = nib.orientations.axcodes2ornt(init_axcodes)
      ornt_fin = nib.orientations.axcodes2ornt(final_axcodes)
      if np.any(np.isnan(ornt_init)) or np.any(np.isnan(ornt_fin)):
          tf.logging.fatal(
              "unknown axcodes %s, %s", ornt_init, ornt_fin
          )
          raise ValueError
      try:
          ornt_transf = nib.orientations.ornt_transform(
              ornt_init, ornt_fin
          )
          return ornt_transf, ornt_init, ornt_fin
      except (ValueError, IndexError):
          tf.logging.fatal(
              "reorientation transform error: %s, %s",
              ornt_init,
              ornt_fin,
          )
          raise ValueError
  
imports: from __future__ import absolute_import, print_function, unicode_literals
  import errno
  import importlib
  import logging
  import os
  import re
  import sys
  import warnings
  import nibabel
  import numpy
  import pandas
  import scipy.ndimage
  import tensorflow
  from tensorflow.core.framework import summary_pb2
  from niftynet.io.image_loader import load_image_obj
  from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
  from niftynet.utilities.util_import import require_module
label_desc: Use image node_id 6 for calling a global function with example usage: compute_orientation(init_axcodes, final_axcodes) and returns: ornt_transf,  ornt_init,  ornt_fin