code: def assignment_map(target_bundle, model_bundle, no_disks):
      """
      Calculates assignment maps of the target bundle with reference to
      model bundle centroids.
  
      Parameters
      ----------
      target_bundle : streamlines
          target bundle extracted from subject data in common space
      model_bundle : streamlines
          atlas bundle used as reference
      no_disks : integer, optional
          Number of disks used for dividing bundle into disks.
  
      Returns
      -------
      indx : ndarray
          Assignment map of the target bundle streamline point indices to the
          model bundle centroid points.
  
      References
      ----------
      .. [Chandio2020] Chandio, B.Q., Risacher, S.L., Pestilli, F., Bullock, D.,
      Yeh, FC., Koudoro, S., Rokem, A., Harezlak, J., and Garyfallidis, E.
      Bundle analytics, a computational framework for investigating the
      shapes and profiles of brain pathways across populations.
      Sci Rep 10, 17149 (2020)
  
      """
  
      mbundle_streamlines = set_number_of_points(
          model_bundle, nb_points=no_disks
      )
  
      metric = AveragePointwiseEuclideanMetric()
      qb = QuickBundles(threshold=85.0, metric=metric)
      clusters = qb.cluster(mbundle_streamlines)
      centroids = Streamlines(clusters.centroids)
  
      _, indx = cKDTree(centroids.get_data(), 1, copy_data=True).query(
          target_bundle.get_data(), k=1
      )
  
      return indx
  
file_path: dipy/dipy/stats/analysis.py
imports: import os
  import numpy
  from scipy.spatial import cKDTree
  from scipy.ndimage import map_coordinates
  from scipy.spatial.distance import mahalanobis
  from dipy.io.utils import save_buan_profiles_hdf5
  from dipy.segment.clustering import QuickBundles
  from dipy.segment.metricspeed import AveragePointwiseEuclideanMetric
  from dipy.tracking.streamline import set_number_of_points, values_from_volume, orient_by_streamline, Streamlines
label_desc: Use image node_id 3 for calling a global function with example usage: assignment_map(target_bundle, model_bundle, no_disks) and returns: indx