code: def Wcons(k_elements):
      r""" Construct the full 4D kurtosis tensors from its 15 independent
      elements
  
      Parameters
      ----------
      k_elements : (15,)
          elements of the kurtosis tensor in the following order:
  
      .. 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}
  
      Returns
      -------
      W : array(3, 3, 3, 3)
          Full 4D kurtosis tensor
  
      """
      W = np.zeros((3, 3, 3, 3))
  
      xyz = [0, 1, 2]
      for ind_i in xyz:
          for ind_j in xyz:
              for ind_k in xyz:
                  for ind_l in xyz:
                      key = (
                          (ind_i + 1)
                          * (ind_j + 1)
                          * (ind_k + 1)
                          * (ind_l + 1)
                      )
                      W[ind_i][ind_j][ind_k][ind_l] = k_elements[
                          ind_ele[key]
                      ]
  
      return W
  
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 26 for calling a global function with example usage: Wcons(k_elements) and returns: W