code: def create_qtable(gtab, origin):
      """create a normalized version of gradients
  
      Parameters
      ----------
      gtab : GradientTable
      origin : (3,) ndarray
          center of qspace
  
      Returns
      -------
      qtable : ndarray
      """
  
      bv = gtab.bvals
      bsorted = np.sort(bv[np.bitwise_not(gtab.b0s_mask)])
      for i in range(len(bsorted)):
          bmin = bsorted[i]
          try:
              if np.sqrt(bv.max() / bmin) > origin + 1:
                  continue
              else:
                  break
          except ZeroDivisionError:
              continue
  
      bv = np.sqrt(bv / bmin)
      qtable = np.vstack((bv, bv, bv)).T * gtab.bvecs
      return np.floor(qtable + 0.5)
  
imports: import numpy
  from scipy.ndimage import map_coordinates
  from scipy.fftpack import fftn, fftshift, ifftshift
  from dipy.reconst.odf import OdfModel, OdfFit
  from dipy.reconst.cache import Cache
  from dipy.reconst.multi_voxel import multi_voxel_fit
label_desc: Use image node_id 2 for calling a global function with example usage: create_qtable(gtab, origin) and returns: np