code: def streamline_registration(
      moving, static, n_points=100, native_resampled=False
  ):
      """Register two collections of streamlines ('bundles') to each other.
  
      Parameters
      ----------
      moving, static : lists of 3 by n, or str
          The two bundles to be registered. Given either as lists of arrays with
          3D coordinates, or strings containing full paths to these files.
  
      n_points : int, optional
          How many points to resample to. Default: 100.
  
      native_resampled : bool, optional
          Whether to return the moving bundle in the original space, but
          resampled in the static space to n_points.
  
      Returns
      -------
      aligned : list
          Streamlines from the moving group, moved to be closely matched to
          the static group.
  
      matrix : array (4, 4)
          The affine transformation that takes us from 'moving' to 'static'
  
      """
      # Load the streamlines, if you were given a file-name
      if isinstance(moving, str):
          moving = load_trk(
              moving, "same", bbox_valid_check=False
          ).streamlines
      if isinstance(static, str):
          static = load_trk(
              static, "same", bbox_valid_check=False
          ).streamlines
  
      srr = StreamlineLinearRegistration()
      srm = srr.optimize(
          static=set_number_of_points(static, n_points),
          moving=set_number_of_points(moving, n_points),
      )
  
      aligned = srm.transform(moving)
      if native_resampled:
          aligned = set_number_of_points(aligned, n_points)
          aligned = transform_tracking_output(
              aligned, np.linalg.inv(srm.matrix)
          )
  
      return aligned, srm.matrix
  
imports: from warnings import warn
  import re
  import collections.abc
  from functools import partial
  import numbers
  import numpy
  import nibabel
  from dipy.align.metrics import CCMetric, EMMetric, SSDMetric
  from dipy.align.imwarp import SymmetricDiffeomorphicRegistration, DiffeomorphicMap
  from dipy.align.imaffine import transform_centers_of_mass, AffineMap, MutualInformationMetric, AffineRegistration
  from dipy.align.transforms import TranslationTransform3D, RigidTransform3D, RigidScalingTransform3D, RigidIsoScalingTransform3D, AffineTransform3D
  import dipy.core.gradients
  import dipy.data
  from dipy.align.streamlinear import StreamlineLinearRegistration
  from dipy.tracking.streamline import set_number_of_points
  from dipy.tracking.utils import transform_tracking_output
  from dipy.io.streamline import load_trk
  from dipy.io.utils import read_img_arr_or_path
  from dipy.io.image import load_nifti, save_nifti
label_desc: Use image node_id 10 for calling a global function with example usage: streamline_registration(moving, static, n_points, native_resampled) and returns: aligned,  srm