code: def test_affine_real_bundles():
      bundle_initial = fornix_streamlines()
      bundle_initial, shift = center_streamlines(bundle_initial)
      bundle = bundle_initial[:20]
      xgold = [0, 4, 2, 0, 10, 10, 1.2, 1.1, 1.0, 0.0, 0.2, 0.0]
      mat = compose_matrix44(xgold)
      bundle2 = transform_streamlines(bundle_initial[:20], mat)
  
      x0 = np.array([0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0])
  
      x = 25
  
      bounds = [
          (-x, x),
          (-x, x),
          (-x, x),
          (-x, x),
          (-x, x),
          (-x, x),
          (0.1, 1.5),
          (0.1, 1.5),
          (0.1, 1.5),
          (-1, 1),
          (-1, 1),
          (-1, 1),
      ]
  
      options = {"maxcor": 10, "ftol": 1e-7, "gtol": 1e-5, "eps": 1e-8}
  
      metric = BundleMinDistanceMatrixMetric()
  
      slr = StreamlineLinearRegistration(
          metric=metric,
          x0=x0,
          method="L-BFGS-B",
          bounds=bounds,
          verbose=True,
          options=options,
      )
      slm = slr.optimize(bundle, bundle2)
  
      new_bundle2 = slm.transform(bundle2)
  
      slr2 = StreamlineLinearRegistration(
          metric=metric,
          x0=x0,
          method="Powell",
          bounds=None,
          verbose=True,
          options=None,
      )
  
      slm2 = slr2.optimize(bundle, new_bundle2)
  
      new_bundle2 = slm2.transform(new_bundle2)
  
      evaluate_convergence(bundle, new_bundle2)
  
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 17 for calling a global function with example usage: test_affine_real_bundles() without return types