code: def test_quickbundles_shape_incompatibility():
      # QuickBundles' old default metric (AveragePointwiseEuclideanMetric,
      #  aka MDF) requires that all streamlines have the same number of points.
      metric = dipysmetric.AveragePointwiseEuclideanMetric()
      qb = QuickBundles(threshold=20.0, metric=metric)
      assert_raises(ValueError, qb.cluster, data)
  
      # QuickBundles' new default metric (AveragePointwiseEuclideanMetric,
      # aka MDF combined with ResampleFeature) will automatically resample
      # streamlines so they all have 18 points.
      qb = QuickBundles(threshold=20.0)
      clusters1 = qb.cluster(data)
  
      feature = dipysfeature.ResampleFeature(nb_points=18)
      metric = dipysmetric.AveragePointwiseEuclideanMetric(feature)
      qb = QuickBundles(threshold=20.0, metric=metric)
      clusters2 = qb.cluster(data)
  
      assert_arrays_equal(
          list(itertools.chain(*clusters1)),
          list(itertools.chain(*clusters2)),
      )
  
file_path: dipy/dipy/segment/tests/test_quickbundles.py
imports: import numpy
  import itertools
  from numpy.testing import assert_array_equal, assert_equal, assert_raises
  from dipy.testing.memory import get_type_refcount
  from dipy.testing import assert_arrays_equal
  from dipy.segment.clustering import QuickBundles
  import dipy.segment.featurespeed
  import dipy.segment.metricspeed
  from dipy.segment.clustering_algorithms import quickbundles
  import dipy.tracking.streamline
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 3 for calling a global function with example usage: test_quickbundles_shape_incompatibility() without return types