code: def _qti_gtab(rng):
      """Return a gradient table with b0, 2 shells, 30 directions, and linear and
      planar tensor encoding for fitting QTI."""
      n_dir = 30
      hsph_initial = HemiSphere(
          theta=np.pi * rng.random(n_dir),
          phi=2 * np.pi * rng.random(n_dir),
      )
      hsph_updated, _ = disperse_charges(hsph_initial, 100)
      directions = hsph_updated.vertices
      bvecs = np.vstack([np.zeros(3)] + [directions for _ in range(4)])
      bvals = np.concatenate(
          (
              np.zeros(1),
              np.ones(n_dir),
              np.ones(n_dir) * 2,
              np.ones(n_dir),
              np.ones(n_dir) * 2,
          )
      )
      btens = np.array(
          ["LTE" for i in range(1 + n_dir * 2)]
          + ["PTE" for i in range(n_dir * 2)]
      )
      gtab = gradient_table(bvals, bvecs, btens=btens)
      return gtab
  
imports: import numpy
  import numpy.testing
  import dipy.reconst.qti
  from dipy.core.gradients import gradient_table
  from dipy.sims.voxel import vec2vec_rotmat
  from dipy.core.sphere import disperse_charges, HemiSphere
  from dipy.reconst.dti import fractional_anisotropy
  from dipy.testing.decorators import set_random_number_generator
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 13 for calling a global function with example usage: _qti_gtab(rng) and returns: gtab