code: def transform_tracking_output(
      tracking_output, affine, save_seeds=False
  ):
      """Apply a linear transformation, given by affine, to streamlines.
  
      Parameters
      ----------
      tracking_output : Streamlines generator
          Either streamlines (list, ArraySequence) or a tuple with streamlines
          and seeds together
      affine : array (4, 4)
          The mapping between voxel indices and the point space for seeds.
          The voxel_to_rasmm matrix, typically from a NIFTI file.
      save_seeds : bool, optional
          If set, seeds associated to streamlines will be also moved and returned
      Returns
      -------
      streamlines : generator
          A generator for the sequence of transformed streamlines.
          If save_seeds is True, also return a generator for the
          transformed seeds.
      """
      lin_T = affine[:3, :3].T.copy()
      offset = affine[:3, 3].copy()
      yield
      # End of initialization
  
      if save_seeds:
          for sl, seed in tracking_output:
              yield np.dot(sl, lin_T) + offset, np.dot(
                  seed, lin_T
              ) + offset
      else:
          for sl in tracking_output:
              yield np.dot(sl, lin_T) + offset
  
imports: from collections import defaultdict, OrderedDict
  from functools import wraps
  from itertools import combinations, groupby
  from warnings import warn
  import numpy
  from nibabel.affines import apply_affine
  from scipy.spatial.distance import cdist
  from dipy.core.geometry import dist_to_corner
  from dipy.tracking import metrics
  from dipy.tracking.vox2track import _streamlines_in_mask
  from dipy.tracking._utils import _mapping_to_voxel, _to_voxel_coordinates
label_desc: Use image node_id 15 for calling a global function with example usage: transform_tracking_output(tracking_output, affine, save_seeds) without return types