code: def test_efficient_bmd():
      a = np.array([[1, 1, 1], [2, 2, 2], [3, 3, 3]])
  
      streamlines = [a, a + 2, a + 4]
  
      points, offsets = unlist_streamlines(streamlines)
      points = points.astype(np.double)
      points2 = points.copy()
  
      D = np.zeros((len(offsets), len(offsets)), dtype="f8")
  
      _bundle_minimum_distance_matrix(
          points, points2, len(offsets), len(offsets), a.shape[0], D
      )
  
      assert_equal(np.sum(np.diag(D)), 0)
  
      points2 += 2
  
      _bundle_minimum_distance_matrix(
          points, points2, len(offsets), len(offsets), a.shape[0], D
      )
  
      streamlines2 = relist_streamlines(points2, offsets)
      D2 = distance_matrix_mdf(streamlines, streamlines2)
  
      assert_array_almost_equal(D, D2)
  
      cols = D2.shape[1]
      rows = D2.shape[0]
  
      dist = (
          0.25
          * (
              np.sum(np.min(D2, axis=0)) / float(cols)
              + np.sum(np.min(D2, axis=1)) / float(rows)
          )
          ** 2
      )
  
      dist2 = _bundle_minimum_distance(
          points, points2, len(offsets), len(offsets), a.shape[0]
      )
      assert_almost_equal(dist, dist2)
  
imports: import numpy
  from numpy.testing import assert_, assert_equal, assert_almost_equal, assert_array_almost_equal, assert_raises
  from dipy.align.streamlinear import compose_matrix44, decompose_matrix44, BundleSumDistanceMatrixMetric, BundleMinDistanceMatrixMetric, BundleMinDistanceMetric, StreamlineLinearRegistration, StreamlineDistanceMetric, groupwise_slr, get_unique_pairs
  from dipy.tracking.streamline import center_streamlines, unlist_streamlines, relist_streamlines, transform_streamlines, set_number_of_points, Streamlines
  from dipy.io.streamline import load_tractogram
  from dipy.core.geometry import compose_matrix
  from dipy.data import get_fnames, two_cingulum_bundles, read_five_af_bundles
  from dipy.align.bundlemin import _bundle_minimum_distance_matrix, _bundle_minimum_distance, distance_matrix_mdf
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 10 for calling a global function with example usage: test_efficient_bmd() without return types