code: def _cluster_streamlines(self, clust_thr, nb_pts):
      if self.verbose:
          t = time()
          logger.info("# Cluster streamlines using QBx")
          logger.info(
              f" Tractogram has {len(self.streamlines)} streamlines"
          )
          logger.info(f" Size is {nbytes(self.streamlines):0.3f} MB")
          logger.info(f" Distance threshold {clust_thr:0.3f}")
  
      # TODO this needs to become a default parameter
      thresholds = self.start_thr + [clust_thr]
  
      merged_cluster_map = qbx_and_merge(
          self.streamlines,
          thresholds,
          nb_pts,
          None,
          self.rng,
          self.verbose,
      )
  
      self.cluster_map = merged_cluster_map
      self.centroids = merged_cluster_map.centroids
      self.nb_centroids = len(self.centroids)
      self.indices = [cluster.indices for cluster in self.cluster_map]
  
      if self.verbose:
          logger.info(
              f" Streamlines have {self.nb_centroids} centroids"
          )
          logger.info(f" Total duration {time() - t:0.3f} s\n")
  
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 2 for calling the RecoBundles obj's underlying member method code with example usage: obj._cluster_streamlines(clust_thr, nb_pts) without return types