code: def test_3D_segments():
      points = np.array(
          [
              [[1, 0, 0], [1, 1, 0]],
              [[3, 1, 0], [3, 0, 0]],
              [[2, 0, 0], [2, 1, 0]],
              [[5, 1, 0], [5, 0, 0]],
              [[5.5, 0, 0], [5.5, 1, 0]],
          ],
          dtype="f4",
      )
  
      thresholds = [4, 2, 1]
  
      feature = ResampleFeature(nb_points=20)
      metric = AveragePointwiseEuclideanMetric(feature)
      qbx = QuickBundlesX(thresholds, metric=metric)
      tree = qbx.cluster(points)
      clusters_0 = tree.get_clusters(0)
      clusters_1 = tree.get_clusters(1)
      clusters_2 = tree.get_clusters(2)
  
      assert_equal(len(clusters_0.centroids), len(clusters_1.centroids))
      assert_equal(
          len(clusters_2.centroids) > len(clusters_1.centroids), True
      )
  
      assert_array_equal(
          clusters_2[1].indices, np.array([3, 4], dtype=np.int32)
      )
  
imports: import itertools
  import numpy
  from numpy.testing import assert_array_equal, assert_equal, assert_raises
  from dipy.segment.clustering import QuickBundlesX, QuickBundles, qbx_and_merge
  from dipy.segment.featurespeed import ResampleFeature
  from dipy.segment.metricspeed import AveragePointwiseEuclideanMetric, MinimumAverageDirectFlipMetric
  from dipy.tracking.streamline import set_number_of_points
  from dipy.tracking.streamline import Streamlines
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 7 for calling a global function with example usage: test_3D_segments() without return types