code: def test_stream_rigid():
      static = fornix_streamlines()[:20]
      moving = fornix_streamlines()[20:40]
      center_streamlines(static)
  
      mat = compose_matrix44([0, 0, 0, 0, 40, 0])
      moving = transform_streamlines(moving, mat)
  
      srr = StreamlineLinearRegistration()
      sr_params = srr.optimize(static, moving)
      moved = transform_streamlines(moving, sr_params.matrix)
  
      srr = StreamlineLinearRegistration(verbose=True)
      srm = srr.optimize(static, moving)
      moved2 = transform_streamlines(moving, srm.matrix)
      moved3 = srm.transform(moving)
  
      assert_array_almost_equal(moved[0], moved2[0], decimal=3)
      assert_array_almost_equal(moved2[0], moved3[0], decimal=3)
  
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 7 for calling a global function with example usage: test_stream_rigid() without return types