code: def reorient_on_axis(bvecs, current_ornt, new_ornt, axis=0):
      if isinstance(current_ornt, str):
          current_ornt = orientation_from_string(current_ornt)
      if isinstance(new_ornt, str):
          new_ornt = orientation_from_string(new_ornt)
  
      n = bvecs.shape[axis]
      if current_ornt.shape != (n, 2) or new_ornt.shape != (n, 2):
          raise ValueError("orientations do not match")
  
      mapping = ornt_mapping(current_ornt, new_ornt)
      order = [slice(None)] * bvecs.ndim
      order[axis] = mapping[:, 0]
      shape = [1] * bvecs.ndim
      shape[axis] = -1
      sign = mapping[:, 1]
      sign.shape = shape
      output = bvecs[order]
      output *= sign
      return output
  
imports: import logging
  from warnings import warn
  import numpy
  from scipy.linalg import inv, polar
  from dipy.io import gradients
  from dipy.core.onetime import auto_attr
  from dipy.core.geometry import vector_norm, vec2vec_rotmat
  from dipy.core.sphere import disperse_charges, HemiSphere
  from dipy.utils.deprecator import deprecate_with_version
label_desc: Use image node_id 21 for calling a global function with example usage: reorient_on_axis(bvecs, current_ornt, new_ornt, axis) and returns: output