code: def _handle_pipeline_inputs(
      moving,
      static,
      static_affine=None,
      moving_affine=None,
      starting_affine=None,
  ):
      """
      Helper function to prepare inputs for pipeline functions
  
      Parameters
      ----------
      moving, static: Either as a 3D/4D array or as a nifti image object, or as
          a string containing the full path to a nifti file.
  
      static_affine, moving_affine: 2D arrays.
          The array associated with the static/moving images.
  
      starting_affine : 2D array, optional.
          This is the registration matrix that is inherited from previous steps
          in the pipeline. Default: 4-by-4 identity matrix.
      """
      static, static_affine = read_img_arr_or_path(
          static, affine=static_affine
      )
      moving, moving_affine = read_img_arr_or_path(
          moving, affine=moving_affine
      )
      if starting_affine is None:
          starting_affine = np.eye(4)
  
      return (
          static,
          static_affine,
          moving,
          moving_affine,
          starting_affine,
      )
  
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 1 for calling a global function with example usage: _handle_pipeline_inputs(moving, static, static_affine, moving_affine, starting_affine) and returns: static,  static_affine,  moving,  moving_affine,  starting_affine