code: def _prune_what_not_in_model(
      self,
      model_centroids,
      transf_streamlines,
      neighb_indices,
      mdf_thr=5,
      pruning_thr=10,
      pruning_distance="mdf",
  ):
      if self.verbose:
          if pruning_thr < 0:
              logger.info("Pruning_thr has to be greater or equal to 0")
  
          logger.info("# Prune streamlines using the MDF distance")
          logger.info(f" Pruning threshold {pruning_thr:0.3f}")
          logger.info(f" Pruning distance {pruning_distance}")
          t = time()
  
      thresholds = [40, 30, 20, 10, mdf_thr]
      rtransf_cluster_map = qbx_and_merge(
          transf_streamlines,
          thresholds,
          nb_pts=20,
          select_randomly=500000,
          rng=self.rng,
      )
      if self.verbose:
          logger.info(f" QB Duration {time() - t:0.3f} s\n")
  
      rtransf_centroids = rtransf_cluster_map.centroids
  
      if pruning_distance.lower() == "mdf":
          if self.verbose:
              logger.info(" Using MDF")
          dist_matrix = bundles_distances_mdf(
              model_centroids, rtransf_centroids
          )
      elif pruning_distance.lower() == "mam":
          if self.verbose:
              logger.info(" Using MAM")
          dist_matrix = bundles_distances_mam(
              model_centroids, rtransf_centroids
          )
      else:
          raise ValueError("Given pruning distance is not available")
      dist_matrix[np.isnan(dist_matrix)] = np.inf
      dist_matrix[dist_matrix > pruning_thr] = np.inf
  
      pruning_matrix = dist_matrix.copy()
      if self.verbose:
          logger.info(
              " Pruning matrix size is (%d, %d)" % pruning_matrix.shape
          )
  
      mins = np.min(pruning_matrix, axis=0)
      pruned_indices = [
          rtransf_cluster_map[i].indices
          for i in np.where(mins != np.inf)[0]
      ]
      pruned_indices = list(chain(*pruned_indices))
      idx = np.array(pruned_indices)
      if len(idx) == 0:
          if self.verbose:
              logger.info(" You have removed all streamlines")
          return Streamlines([]), []
  
      pruned_streamlines = transf_streamlines[idx]
  
      initial_indices = list(chain(*neighb_indices))
      final_indices = [initial_indices[i] for i in pruned_indices]
      labels = final_indices
      if self.verbose:
          logger.info(f" Number of centroids: {len(rtransf_centroids)}")
          logger.info(
              f" Number of streamlines after pruning:"
              f" {len(pruned_streamlines)}"
          )
          logger.info(f" Duration {time() - t:0.3f} s\n")
  
      return pruned_streamlines, labels
  
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 9 for calling the RecoBundles obj's underlying member method code with example usage: obj._prune_what_not_in_model(model_centroids, transf_streamlines, neighb_indices, mdf_thr, pruning_thr, pruning_distance) and returns: pruned_streamlines,  labels, Streamlines,  list