class_docstr: Class for fitting the Correlation Tensor Model 
class_docstr_tok: ["Class","for","fitting","the","Correlation","Tensor","Model"]
docstr: Returns the anisotropic Source of Kurtosis (K_aniso)
  
      Notes
      -----
      The K_aniso is defined as[1]_:
  
      :math::
  
      \[K_{aniso} = \frac{6}{5} \cdot \frac{\langle V_{\lambda}(D_c)
                                            \rangle}{\overline{D}^2}\]
  
  where: $K_{aniso}$ is the anisotropic kurtosis,
      $\langle V_{\lambda}(D_c) \rangle$ represents the mean of the
      variance of eigenvalues of the diffusion tensor,
      $\overline{D}$ is the mean of the diffusion tensor.
  
  References
  ----------
  .. [1]  [NetoHe2020] Henriques, R.N., Jespersen, S.N., Shemesh, N., 2020.
          Correlation tensor magnetic resonance imaging. Neuroimage 211.
          doi: 10.1016/j.neuroimage.2020.116605
docstr_tok: ["Returns","the","anisotropic","Source","of","Kurtosis","(","K_aniso",")","Notes","--","--","-","The","K_aniso","is","defined","as","[","1","]","_",":",":","math",":",":","\\","[","K_","{","aniso","}","=","\\frac","{","6","}","{","5","}","\\cdot","\\frac","{","\\langle","V_","{","\\lambda","}","(","D_c",")","\\rangle","}","{","\\overline","{","D","}","^2","}","\\","]","where",":","$","K_","{","aniso","}","$","is","the","anisotropic","kurtosis",",","$","\\langle","V_","{","\\lambda","}","(","D_c",")","\\rangle","$","represents","the","mean","of","the","variance","of","eigenvalues","of","the","diffusion","tensor",",","$","\\overline","{","D","}","$","is","the","mean","of","the","diffusion","tensor",".","References","--","--","--","--","--","..","[","1","]","[","NetoHe2020","]","Henriques",",","R.N.",",","Jespersen",",","S.N.",",","Shemesh",",","N.",",","2020",".","Correlation","tensor","magnetic","resonance","imaging",".","Neuroimage","211.","doi",":","10.1016\/j.neuroimage.2020.116605"]
code: def K_aniso(self):
      r"""Returns the anisotropic Source of Kurtosis (K_aniso)
  
          Notes
          -----
          The K_aniso is defined as[1]_:
  
          :math::
  
          \[K_{aniso} = \frac{6}{5} \cdot \frac{\langle V_{\lambda}(D_c)
                                                \rangle}{\overline{D}^2}\]
  
      where: $K_{aniso}$ is the anisotropic kurtosis,
          $\langle V_{\lambda}(D_c) \rangle$ represents the mean of the
          variance of eigenvalues of the diffusion tensor,
          $\overline{D}$ is the mean of the diffusion tensor.
  
      References
      ----------
      .. [1]  [NetoHe2020] Henriques, R.N., Jespersen, S.N., Shemesh, N., 2020.
              Correlation tensor magnetic resonance imaging. Neuroimage 211.
              doi: 10.1016/j.neuroimage.2020.116605
      """
      C = self.ct
      D = self.quadratic_form
  
      Variance = (
          2
          / 9
          * (
              C[..., 0]
              + D[..., 0, 0] ** 2
              + C[..., 1]
              + D[..., 1, 1] ** 2
              + C[..., 2]
              + D[..., 2, 2] ** 2
              - C[..., 5]
              - D[..., 0, 0] * D[..., 1, 1]
              - C[..., 4]
              - D[..., 0, 0] * D[..., 2, 2]
              - C[..., 3]
              - D[..., 1, 1] * D[..., 2, 2]
              + 3
              * (
                  C[..., 17]
                  + D[..., 0, 1] ** 2
                  + C[..., 16]
                  + D[..., 0, 2] ** 2
                  + C[..., 15]
                  + D[..., 1, 2] ** 2
              )
          )
      )
      mean_D = np.trace(D) / 3
      if mean_D == 0:
          K_aniso = 0
      else:
          K_aniso = (6 / 5) * (Variance / (mean_D**2))
  
      return K_aniso
  
imports: import numpy
  from dipy.reconst.multi_voxel import multi_voxel_fit
  from dipy.reconst.base import ReconstModel
  from dipy.reconst.utils import cti_design_matrix
  from dipy.reconst.dki import DiffusionKurtosisFit
  from dipy.reconst.dti import decompose_tensor, from_lower_triangular, lower_triangular, MIN_POSITIVE_SIGNAL
  from dipy.core.onetime import auto_attr
label_desc: Use image node_id 4 for calling the CorrelationTensorFit obj's underlying member method code with example usage: obj.K_aniso() and returns: K_aniso