code: def ba_analysis(
      recognized_bundle, expert_bundle, nb_pts=20, threshold=6.0
  ):
      """Calculates bundle adjacency score between two given bundles
  
      Parameters
      ----------
      recognized_bundle : Streamlines
          Extracted bundle from the whole brain tractogram (eg: AF_L)
      expert_bundle : Streamlines
          Model bundle used as reference while extracting similar type bundle
          from input tractogram
      nb_pts : integer (default 20)
          Discretizing streamlines to have nb_pts number of points
      threshold : float (default 6)
          Threshold used for in computing bundle adjacency. Threshold controls
          how much strictness user wants while calculating bundle adjacency
          between two bundles. Smaller threshold means bundles should be strictly
          adjacent to get higher BA score.
  
      Returns
      -------
          Bundle adjacency score between two tracts
  
      References
      ----------
      .. [Garyfallidis12] Garyfallidis E. et al., QuickBundles a method for
                          tractography simplification, Frontiers in Neuroscience,
                          vol 6, no 175, 2012.
      """
  
      recognized_bundle = set_number_of_points(
          recognized_bundle, nb_pts
      )
  
      expert_bundle = set_number_of_points(expert_bundle, nb_pts)
  
      return bundle_adjacency(
          recognized_bundle, expert_bundle, threshold
      )
  
imports: from time import time
  from itertools import chain
  import logging
  import numpy
  from dipy.tracking.streamline import set_number_of_points, nbytes, select_random_set_of_streamlines
  from dipy.segment.clustering import qbx_and_merge
  from dipy.tracking.distances import bundles_distances_mdf, bundles_distances_mam
  from dipy.align.streamlinear import StreamlineLinearRegistration, BundleMinDistanceMetric, BundleSumDistanceMatrixMetric, BundleMinDistanceAsymmetricMetric
  from dipy.tracking.streamline import Streamlines, length
  from dipy.utils.deprecator import deprecated_params
  from nibabel.affines import apply_affine
label_desc: Use image node_id 3 for calling a global function with example usage: ba_analysis(recognized_bundle, expert_bundle, nb_pts, threshold) and returns: bundle_adjacency