code: def mbessel_ratio(n, x):
      r"""
      Fast computation of modified Bessel function ratio (first kind).
  
      Computes:
  
      $I_{n}(x) / I_{n-1}(x)$
  
      using Perron's continued fraction equation where $I_n$ is the modified
      Bessel function of first kind, order $n$ [1]_.
  
      Parameters
      ----------
      n : int
          Order of Bessel function in numerator (denominator is of order n-1).
          Must be a positive int.
      x : float or ndarray
          Value or array of values with which to compute ratio.
  
      Returns
      -------
      y : float or ndarray
          Result of ratio computation.
  
      References
      ----------
      .. [1] W. Gautschi and J. Slavik, “On the computation of modified Bessel
             function ratios,” Math. Comp., vol. 32, no. 143, pp. 865–875, 1978,
             doi: 10.1090/S0025-5718-1978-0470267-9
      """
  
      y = x / (
          (2 * n + x)
          - (
              2
              * x
              * (n + 1 / 2)
              / (
                  2 * n
                  + 1
                  + 2 * x
                  - (
                      2
                      * x
                      * (n + 3 / 2)
                      / (
                          2 * n
                          + 2
                          + 2 * x
                          - (2 * x * (n + 5 / 2) / (2 * n + 3 + 2 * x))
                      )
                  )
              )
          )
      )
  
      return y
  
imports: import logging
  import warnings
  import numpy
  from dipy.core.geometry import vec2vec_rotmat
  from dipy.core.gradients import gradient_table, unique_bvals_tolerance, get_bval_indices
  from dipy.core.onetime import auto_attr
  from dipy.core.sphere import Sphere
  from dipy.data import get_sphere
  from dipy.reconst.shm import lazy_index, normalize_data
  from dipy.reconst.odf import OdfModel, OdfFit
  from dipy.reconst.csdeconv import AxSymShResponse
  from dipy.segment.mask import bounding_box, crop
  from dipy.sims.voxel import single_tensor, all_tensor_evecs
label_desc: Use image node_id 2 for calling a global function with example usage: mbessel_ratio(n, x) and returns: y