docstr: A map holding the optimum affine matrices for halfway streamline
  linear registration and some other parameters of the optimization.
  
  xopt is optimized by StreamlineLinearRegistration using the
  JointBundleMinDistanceMetric. In that case the mat argument of the
  optimize method needs to be np.eye(4) to avoid streamline centering.
  
  This constructor derives and stores the transformations to move both
  static and moving bundles to the halfway space.
  
  Parameters
  ----------
  xopt : array
      1d array with the parameters of the transformation.
  
  fopt : float
      Final value of the metric.
  
  matopt_history : array
      All transformation matrices created during the optimization.
  
  funcs : int
      Number of function evaluations of the optimizer.
  
  iterations : int
      Number of iterations of the optimizer.
docstr_tok: ["A","map","holding","the","optimum","affine","matrices","for","halfway","streamline","linear","registration","and","some","other","parameters","of","the","optimization",".","xopt","is","optimized","by","StreamlineLinearRegistration","using","the","JointBundleMinDistanceMetric",".","In","that","case","the","mat","argument","of","the","optimize","method","needs","to","be","np.eye","(","4",")","to","avoid","streamline","centering",".","This","constructor","derives","and","stores","the","transformations","to","move","both","static","and","moving","bundles","to","the","halfway","space",".","Parameters","--","--","--","--","--","xopt",":","array","1d","array","with","the","parameters","of","the","transformation",".","fopt",":","float","Final","value","of","the","metric",".","matopt_history",":","array","All","transformation","matrices","created","during","the","optimization",".","funcs",":","int","Number","of","function","evaluations","of","the","optimizer",".","iterations",":","int","Number","of","iterations","of","the","optimizer","."]
code: def __init__(self, xopt, fopt, matopt_history, funcs, iterations):
      """A map holding the optimum affine matrices for halfway streamline
      linear registration and some other parameters of the optimization.
  
      xopt is optimized by StreamlineLinearRegistration using the
      JointBundleMinDistanceMetric. In that case the mat argument of the
      optimize method needs to be np.eye(4) to avoid streamline centering.
  
      This constructor derives and stores the transformations to move both
      static and moving bundles to the halfway space.
  
      Parameters
      ----------
      xopt : array
          1d array with the parameters of the transformation.
  
      fopt : float
          Final value of the metric.
  
      matopt_history : array
          All transformation matrices created during the optimization.
  
      funcs : int
          Number of function evaluations of the optimizer.
  
      iterations : int
          Number of iterations of the optimizer.
  
      """
  
      trans, angles, scale, shear = (
          xopt[:3],
          xopt[3:6],
          xopt[6:9],
          xopt[9:],
      )
  
      self.x1 = np.concatenate(
          (trans / 2, angles / 2, (1 + scale) / 2, shear / 2)
      )
      self.x2 = np.concatenate(
          (-trans / 2, -angles / 2, 2 / (1 + scale), -shear / 2)
      )
      self.matrix1 = compose_matrix44(self.x1)
      self.matrix2 = compose_matrix44(self.x2)
      self.fopt = fopt
      self.matrix_history = matopt_history
      self.funcs = funcs
      self.iterations = iterations
  
imports: import logging
  import abc
  from itertools import combinations
  import numpy
  from dipy.core.optimize import Optimizer
  from dipy.align.bundlemin import _bundle_minimum_distance, _bundle_minimum_distance_asymmetric, distance_matrix_mdf
  from dipy.tracking.streamline import transform_streamlines, unlist_streamlines, center_streamlines, set_number_of_points, select_random_set_of_streamlines, length, Streamlines
  from dipy.segment.clustering import qbx_and_merge
  from dipy.core.geometry import compose_transformations, compose_matrix, decompose_matrix
  from time import time
label_desc: Use image node_id 1 to create a new JointStreamlineRegistrationMap object  with example: obj = JointStreamlineRegistrationMap(xopt, fopt, matopt_history, funcs, iterations)