class_docstr: Class for fitting the Diffusion Kurtosis Model
docstr: Given a DKI model fit, predict the signal on the vertices of a
  gradient table
  
  Parameters
  ----------
  gtab : a GradientTable class instance
      The gradient table for this prediction
  
  S0 : float or ndarray (optional)
      The non diffusion-weighted signal in every voxel, or across all
      voxels. Default: 1
  
  Notes
  -----
  The predicted signal is given by:
  
  .. math::
  
      S(n,b)=S_{0}e^{-bD(n)+\frac{1}{6}b^{2}D(n)^{2}K(n)}
  
  $\mathbf{D(n)}$ and $\mathbf{K(n)}$ can be computed from the DT and KT
  using the following equations:
  
  .. math::
  
      D(n)=\sum_{i=1}^{3}\sum_{j=1}^{3}n_{i}n_{j}D_{ij}
  
  and
  
  .. math::
  
      K(n)=\frac{MD^{2}}{D(n)^{2}}\sum_{i=1}^{3}\sum_{j=1}^{3}
      \sum_{k=1}^{3}\sum_{l=1}^{3}n_{i}n_{j}n_{k}n_{l}W_{ijkl}
  
  where $D_{ij}$ and $W_{ijkl}$ are the elements of the second-order DT
  and the fourth-order KT tensors, respectively, and $MD$ is the mean
  diffusivity.
docstr_tok: ["Given","a","DKI","model","fit",",","predict","the","signal","on","the","vertices","of","a","gradient","table","Parameters","--","--","--","--","--","gtab",":","a","GradientTable","class","instance","The","gradient","table","for","this","prediction","S0",":","float","or","ndarray","(","optional",")","The","non","diffusion-weighted","signal","in","every","voxel",",","or","across","all","voxels",".","Default",":","1","Notes","--","--","-","The","predicted","signal","is","given","by",":","..","math",":",":","S","(","n",",","b",")","=S_","{","0","}","e^","{","-bD","(","n",")","+\\frac","{","1","}","{","6","}","b^","{","2","}","D","(","n",")","^","{","2","}","K","(","n",")","}","$","\\mathbf","{","D","(","n",")","}","$","and","$","\\mathbf","{","K","(","n",")","}","$","can","be","computed","from","the","DT","and","KT","using","the","following","equations",":","..","math",":",":","D","(","n",")","=\\sum_","{","i=1","}","^","{","3","}","\\sum_","{","j=1","}","^","{","3","}","n_","{","i","}","n_","{","j","}","D_","{","ij","}","and","..","math",":",":","K","(","n",")","=\\frac","{","MD^","{","2","}","}","{","D","(","n",")","^","{","2","}","}","\\sum_","{","i=1","}","^","{","3","}","\\sum_","{","j=1","}","^","{","3","}","\\sum_","{","k=1","}","^","{","3","}","\\sum_","{","l=1","}","^","{","3","}","n_","{","i","}","n_","{","j","}","n_","{","k","}","n_","{","l","}","W_","{","ijkl","}","where","$","D_","{","ij","}","$","and","$","W_","{","ijkl","}","$","are","the","elements","of","the","second-order","DT","and","the","fourth-order","KT","tensors",",","respectively",",","and","$","MD","$","is","the","mean","diffusivity","."]
code: def predict(self, gtab, S0=1.0):
      r"""Given a DKI model fit, predict the signal on the vertices of a
      gradient table
  
      Parameters
      ----------
      gtab : a GradientTable class instance
          The gradient table for this prediction
  
      S0 : float or ndarray (optional)
          The non diffusion-weighted signal in every voxel, or across all
          voxels. Default: 1
  
      Notes
      -----
      The predicted signal is given by:
  
      .. math::
  
          S(n,b)=S_{0}e^{-bD(n)+\frac{1}{6}b^{2}D(n)^{2}K(n)}
  
      $\mathbf{D(n)}$ and $\mathbf{K(n)}$ can be computed from the DT and KT
      using the following equations:
  
      .. math::
  
          D(n)=\sum_{i=1}^{3}\sum_{j=1}^{3}n_{i}n_{j}D_{ij}
  
      and
  
      .. math::
  
          K(n)=\frac{MD^{2}}{D(n)^{2}}\sum_{i=1}^{3}\sum_{j=1}^{3}
          \sum_{k=1}^{3}\sum_{l=1}^{3}n_{i}n_{j}n_{k}n_{l}W_{ijkl}
  
      where $D_{ij}$ and $W_{ijkl}$ are the elements of the second-order DT
      and the fourth-order KT tensors, respectively, and $MD$ is the mean
      diffusivity.
  
      """
      return dki_prediction(self.model_params, gtab, S0)
  
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 10 for calling the DiffusionKurtosisFit obj's underlying member method code with example usage: obj.predict(gtab, S0) and returns: dki_prediction