code: def Wrotate(kt, Basis):
      r""" Rotate a kurtosis tensor from the standard Cartesian coordinate system
      to another coordinate system basis
  
      Parameters
      ----------
      kt : (15,)
          Vector with the 15 independent elements of the kurtosis tensor
      Basis : array (3, 3)
          Vectors of the basis column-wise oriented
      inds : array(m, 4) (optional)
          Array of vectors containing the four indexes of m specific elements of
          the rotated kurtosis tensor. If not specified all 15 elements of the
          rotated kurtosis tensor are computed.
  
      Returns
      -------
      Wrot : array (m,) or (15,)
          Vector with the m independent elements of the rotated kurtosis tensor.
          If 'indices' is not specified all 15 elements of the rotated kurtosis
          tensor are computed.
  
      Notes
      -----
      KT elements are assumed to be ordered as follows:
  
      .. math::
  
      \begin{matrix} ( & W_{xxxx} & W_{yyyy} & W_{zzzz} & W_{xxxy} & W_{xxxz}
                       & ... \\
                       & W_{xyyy} & W_{yyyz} & W_{xzzz} & W_{yzzz} & W_{xxyy}
                       & ... \\
                       & W_{xxzz} & W_{yyzz} & W_{xxyz} & W_{xyyz} & W_{xyzz}
                       & & )\end{matrix}
  
      References
      ----------
      [1] Hui ES, Cheung MM, Qi L, Wu EX, 2008. Towards better MR
      characterization of neural tissues using directional diffusion kurtosis
      analysis. Neuroimage 42(1): 122-34
  
      """
      inds = np.array(
          [
              [0, 0, 0, 0],
              [1, 1, 1, 1],
              [2, 2, 2, 2],
              [0, 0, 0, 1],
              [0, 0, 0, 2],
              [0, 1, 1, 1],
              [1, 1, 1, 2],
              [0, 2, 2, 2],
              [1, 2, 2, 2],
              [0, 0, 1, 1],
              [0, 0, 2, 2],
              [1, 1, 2, 2],
              [0, 0, 1, 2],
              [0, 1, 1, 2],
              [0, 1, 2, 2],
          ]
      )
  
      Wrot = np.zeros(kt.shape)
  
      for e in range(len(inds)):
          Wrot[..., e] = Wrotate_element(
              kt, inds[e][0], inds[e][1], inds[e][2], inds[e][3], Basis
          )
  
      return Wrot
  
imports: import numpy
  import warnings
  import scipy.optimize
  import dipy.core.sphere
  from dipy.reconst.multi_voxel import multi_voxel_fit
  from dipy.reconst.dti import TensorFit, mean_diffusivity, from_lower_triangular, lower_triangular, decompose_tensor, MIN_POSITIVE_SIGNAL, nlls_fit_tensor, restore_fit_tensor
  from dipy.reconst.utils import dki_design_matrix
  from dipy.reconst.recspeed import local_maxima
  from dipy.reconst.base import ReconstModel
  from dipy.core.ndindex import ndindex
  from dipy.core.geometry import sphere2cart, cart2sphere, perpendicular_directions
  from dipy.core.optimize import PositiveDefiniteLeastSquares
  from dipy.data import get_sphere, get_fnames, load_sdp_constraints
  from dipy.reconst.vec_val_sum import vec_val_vect
  from dipy.core.gradients import check_multi_b
label_desc: Use image node_id 24 for calling a global function with example usage: Wrotate(kt, Basis) and returns: Wrot