class_docstr: Bundle-based Minimum Distance for joint optimization.
  
  This cost function is used by the StreamlineLinearRegistration class when
  running halfway streamline linear registration for unbiased groupwise
  bundle registration and atlasing.
  
  It computes the BMD distance after moving both static and moving bundles to
  a halfway space in between both.
  
  Methods
  -------
  setup(static, moving)
  distance(xopt)
  
  Notes
  -----
  In this metric both static and moving bundles are treated equally (i.e.,
  there is no static reference bundle as both are intended to move). The
  naming convention is kept for consistency.
class_docstr_tok: ["Bundle-based","Minimum","Distance","for","joint","optimization",".","This","cost","function","is","used","by","the","StreamlineLinearRegistration","class","when","running","halfway","streamline","linear","registration","for","unbiased","groupwise","bundle","registration","and","atlasing",".","It","computes","the","BMD","distance","after","moving","both","static","and","moving","bundles","to","a","halfway","space","in","between","both",".","Methods","--","--","--","-","setup","(","static",",","moving",")","distance","(","xopt",")","Notes","--","--","-","In","this","metric","both","static","and","moving","bundles","are","treated","equally","(","i.e.",",","there","is","no","static","reference","bundle","as","both","are","intended","to","move",")",".","The","naming","convention","is","kept","for","consistency","."]
docstr: Setup static and moving sets of streamlines.
  
  Parameters
  ----------
  static : streamlines
      Set of streamlines
  moving : streamlines
      Set of streamlines
  
  Notes
  -----
  Call this after the object is initiated and before distance.
  Num_threads is not used in this class.
docstr_tok: ["Setup","static","and","moving","sets","of","streamlines",".","Parameters","--","--","--","--","--","static",":","streamlines","Set","of","streamlines","moving",":","streamlines","Set","of","streamlines","Notes","--","--","-","Call","this","after","the","object","is","initiated","and","before","distance",".","Num_threads","is","not","used","in","this","class","."]
code: def setup(self, static, moving):
      """Setup static and moving sets of streamlines.
  
      Parameters
      ----------
      static : streamlines
          Set of streamlines
      moving : streamlines
          Set of streamlines
  
      Notes
      -----
      Call this after the object is initiated and before distance.
      Num_threads is not used in this class.
      """
      self.static = static
      self.moving = moving
  
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 for calling the JointBundleMinDistanceMetric obj's underlying member method code with example usage: obj.setup(static, moving) without return types