code: def directional_diffusion(dt, V, min_diffusivity=0):
      r"""Calculate the apparent diffusion coefficient (adc) in each direction of
      a sphere for a single voxel [1]_
  
      Parameters
      ----------
      dt : array (6,)
          elements of the diffusion tensor of the voxel.
      V : array (g, 3)
          g directions of a Sphere in Cartesian coordinates
      min_diffusivity : float (optional)
          Because negative eigenvalues are not physical and small eigenvalues
          cause quite a lot of noise in diffusion-based metrics, diffusivity
          values smaller than `min_diffusivity` are replaced with
          `min_diffusivity`. Default = 0
  
      Returns
      -------
      adc : ndarray (g,)
          Apparent diffusion coefficient (adc) in all g directions of a sphere
          for a single voxel.
  
      References
      ----------
      .. [1] Neto Henriques R, Correia MM, Nunes RG, Ferreira HA (2015).
             Exploring the 3D geometry of the diffusion kurtosis tensor -
             Impact on the development of robust tractography procedures and
             novel biomarkers, NeuroImage 111: 85-99
      """
      adc = (
          V[:, 0] * V[:, 0] * dt[0]
          + 2 * V[:, 0] * V[:, 1] * dt[1]
          + V[:, 1] * V[:, 1] * dt[2]
          + 2 * V[:, 0] * V[:, 2] * dt[3]
          + 2 * V[:, 1] * V[:, 2] * dt[4]
          + V[:, 2] * V[:, 2] * dt[5]
      )
  
      if min_diffusivity is not None:
          adc = adc.clip(min=min_diffusivity)
      return adc
  
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 6 for calling a global function with example usage: directional_diffusion(dt, V, min_diffusivity) and returns: adc