class_docstr: Class for fitting the Diffusion Kurtosis Model
docstr: Calculate the apparent kurtosis coefficient (AKC) in each
  direction on the sphere for each voxel in the data
  
  Parameters
  ----------
  sphere : Sphere class instance
  
  Returns
  -------
  akc : ndarray
     The estimates of the apparent kurtosis coefficient in every
     direction on the input sphere
  
  Notes
  -----
  For each sphere direction with coordinates $(n_{1}, n_{2}, n_{3})$, the
  calculation of AKC is done using formula:
  
  .. math ::
  
      AKC(n)=\frac{MD^{2}}{ADC(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 $W_{ijkl}$ are the elements of the kurtosis tensor, MD the mean
  diffusivity and ADC the apparent diffusion coefficient computed as:
  
  .. math ::
  
      ADC(n)=\sum_{i=1}^{3}\sum_{j=1}^{3}n_{i}n_{j}D_{ij}
  
  where $D_{ij}$ are the elements of the diffusion tensor.
docstr_tok: ["Calculate","the","apparent","kurtosis","coefficient","(","AKC",")","in","each","direction","on","the","sphere","for","each","voxel","in","the","data","Parameters","--","--","--","--","--","sphere",":","Sphere","class","instance","Returns","--","--","--","-","akc",":","ndarray","The","estimates","of","the","apparent","kurtosis","coefficient","in","every","direction","on","the","input","sphere","Notes","--","--","-","For","each","sphere","direction","with","coordinates","$","(","n_","{","1","}",",","n_","{","2","}",",","n_","{","3","}",")","$",",","the","calculation","of","AKC","is","done","using","formula",":","..","math",":",":","AKC","(","n",")","=\\frac","{","MD^","{","2","}","}","{","ADC","(","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","$","W_","{","ijkl","}","$","are","the","elements","of","the","kurtosis","tensor",",","MD","the","mean","diffusivity","and","ADC","the","apparent","diffusion","coefficient","computed","as",":","..","math",":",":","ADC","(","n",")","=\\sum_","{","i=1","}","^","{","3","}","\\sum_","{","j=1","}","^","{","3","}","n_","{","i","}","n_","{","j","}","D_","{","ij","}","where","$","D_","{","ij","}","$","are","the","elements","of","the","diffusion","tensor","."]
code: def akc(self, sphere):
      r"""Calculate the apparent kurtosis coefficient (AKC) in each
      direction on the sphere for each voxel in the data
  
      Parameters
      ----------
      sphere : Sphere class instance
  
      Returns
      -------
      akc : ndarray
         The estimates of the apparent kurtosis coefficient in every
         direction on the input sphere
  
      Notes
      -----
      For each sphere direction with coordinates $(n_{1}, n_{2}, n_{3})$, the
      calculation of AKC is done using formula:
  
      .. math ::
  
          AKC(n)=\frac{MD^{2}}{ADC(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 $W_{ijkl}$ are the elements of the kurtosis tensor, MD the mean
      diffusivity and ADC the apparent diffusion coefficient computed as:
  
      .. math ::
  
          ADC(n)=\sum_{i=1}^{3}\sum_{j=1}^{3}n_{i}n_{j}D_{ij}
  
      where $D_{ij}$ are the elements of the diffusion tensor.
  
      """
      return apparent_kurtosis_coef(self.model_params, sphere)
  
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 3 for calling the DiffusionKurtosisFit obj's underlying member method code with example usage: obj.akc(sphere) and returns: apparent_kurtosis_coef