class_docstr: Class for fitting the Diffusion Kurtosis Model
docstr: Compute mean of the kurtosis tensor (MKT) [1]_
  
  Parameters
  ----------
  min_kurtosis : float (optional)
      To keep kurtosis values within a plausible biophysical range, mean
      kurtosis values that are smaller than `min_kurtosis` are replaced
      with `min_kurtosis`. Default = -3./7 (theoretical kurtosis limit
      for regions that consist of water confined to spherical pores [2]_)
  max_kurtosis : float (optional)
      To keep kurtosis values within a plausible biophysical range, mean
      kurtosis values that are larger than `max_kurtosis` are replaced
      with `max_kurtosis`. Default = 10
  
  Returns
  -------
  mkt : array
      Calculated mean kurtosis tensor.
  
  Notes
  -----
  The MKT is defined as [1]_:
  
  .. math::
  
       MKT \equiv \frac{1}{4\pi} \int d
       \Omega_{\mathnbf{n}} n_i n_j n_k n_l W_{ijkl}
  
  
  which can be directly computed from the trace of the kurtosis tensor:
  
  .. math::
  
  MKT = \frac{1}{5} Tr(\mathbf{W}) = \frac{1}{5}
  (W_{1111} + W_{2222} + W_{3333} + 2W_{1122} + 2W_{1133} + 2W_{2233})
  
  References
  ----------
  .. [1] Hansen, B., Lund, T. E., Sangill, R., and Jespersen, S. N. 2013.
         Experimentally and computationally fast method for estimation
         of a mean kurtosis. Magnetic Resonance in Medicine69, 1754–1760.
         388. doi:10.1002/mrm.24743
  .. [2] Barmpoutis, A., & Zhuo, J., 2011. Diffusion kurtosis imaging:
         Robust estimation from DW-MRI using homogeneous polynomials.
         Proceedings of the 8th {IEEE} International Symposium on
         Biomedical Imaging: From Nano to Macro, ISBI 2011, 262-265.
         doi: 10.1109/ISBI.2011.5872402
docstr_tok: ["Compute","mean","of","the","kurtosis","tensor","(","MKT",")","[","1","]","_","Parameters","--","--","--","--","--","min_kurtosis",":","float","(","optional",")","To","keep","kurtosis","values","within","a","plausible","biophysical","range",",","mean","kurtosis","values","that","are","smaller","than","`","min_kurtosis","`","are","replaced","with","`","min_kurtosis","`",".","Default","=","-3.\/7","(","theoretical","kurtosis","limit","for","regions","that","consist","of","water","confined","to","spherical","pores","[","2","]","_",")","max_kurtosis",":","float","(","optional",")","To","keep","kurtosis","values","within","a","plausible","biophysical","range",",","mean","kurtosis","values","that","are","larger","than","`","max_kurtosis","`","are","replaced","with","`","max_kurtosis","`",".","Default","=","10","Returns","--","--","--","-","mkt",":","array","Calculated","mean","kurtosis","tensor",".","Notes","--","--","-","The","MKT","is","defined","as","[","1","]","_",":","..","math",":",":","MKT","\\equiv","\\frac","{","1","}","{","4\\pi","}","\\int","d","\\Omega_","{","\\mathnbf","{","n","}","}","n_i","n_j","n_k","n_l","W_","{","ijkl","}","which","can","be","directly","computed","from","the","trace","of","the","kurtosis","tensor",":","..","math",":",":","MKT","=","\\frac","{","1","}","{","5","}","Tr","(","\\mathbf","{","W","}",")","=","\\frac","{","1","}","{","5","}","(","W_","{","1111","}","+","W_","{","2222","}","+","W_","{","3333","}","+","2W_","{","1122","}","+","2W_","{","1133","}","+","2W_","{","2233","}",")","References","--","--","--","--","--","..","[","1","]","Hansen",",","B.",",","Lund",",","T.","E.",",","Sangill",",","R.",",","and","Jespersen",",","S.","N.","2013",".","Experimentally","and","computationally","fast","method","for","estimation","of","a","mean","kurtosis",".","Magnetic","Resonance","in","Medicine69",",","1754\u20131760",".","388.","doi:10.1002\/mrm.24743","..","[","2","]","Barmpoutis",",","A.",",","&","Zhuo",",","J.",",","2011",".","Diffusion","kurtosis","imaging",":","Robust","estimation","from","DW-MRI","using","homogeneous","polynomials",".","Proceedings","of","the","8th","{","IEEE","}","International","Symposium","on","Biomedical","Imaging",":","From","Nano","to","Macro",",","ISBI","2011",",","262-265.","doi",":","10.1109\/ISBI.2011.5872402"]
code: def mkt(self, min_kurtosis=-3.0 / 7, max_kurtosis=10):
      r"""Compute mean of the kurtosis tensor (MKT) [1]_
  
      Parameters
      ----------
      min_kurtosis : float (optional)
          To keep kurtosis values within a plausible biophysical range, mean
          kurtosis values that are smaller than `min_kurtosis` are replaced
          with `min_kurtosis`. Default = -3./7 (theoretical kurtosis limit
          for regions that consist of water confined to spherical pores [2]_)
      max_kurtosis : float (optional)
          To keep kurtosis values within a plausible biophysical range, mean
          kurtosis values that are larger than `max_kurtosis` are replaced
          with `max_kurtosis`. Default = 10
  
      Returns
      -------
      mkt : array
          Calculated mean kurtosis tensor.
  
      Notes
      -----
      The MKT is defined as [1]_:
  
      .. math::
  
           MKT \equiv \frac{1}{4\pi} \int d
           \Omega_{\mathnbf{n}} n_i n_j n_k n_l W_{ijkl}
  
  
      which can be directly computed from the trace of the kurtosis tensor:
  
      .. math::
  
      MKT = \frac{1}{5} Tr(\mathbf{W}) = \frac{1}{5}
      (W_{1111} + W_{2222} + W_{3333} + 2W_{1122} + 2W_{1133} + 2W_{2233})
  
      References
      ----------
      .. [1] Hansen, B., Lund, T. E., Sangill, R., and Jespersen, S. N. 2013.
             Experimentally and computationally fast method for estimation
             of a mean kurtosis. Magnetic Resonance in Medicine69, 1754–1760.
             388. doi:10.1002/mrm.24743
      .. [2] Barmpoutis, A., & Zhuo, J., 2011. Diffusion kurtosis imaging:
             Robust estimation from DW-MRI using homogeneous polynomials.
             Proceedings of the 8th {IEEE} International Symposium on
             Biomedical Imaging: From Nano to Macro, ISBI 2011, 262-265.
             doi: 10.1109/ISBI.2011.5872402
      """
      return mean_kurtosis_tensor(
          self.model_params, min_kurtosis, max_kurtosis
      )
  
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 8 for calling the DiffusionKurtosisFit obj's underlying member method code with example usage: obj.mkt(min_kurtosis, max_kurtosis) and returns: mean_kurtosis_tensor