code: def midpoint2point(xyz, p):
      """Calculate distance from midpoint of a curve to arbitrary point p
  
      Parameters
      ----------
      xyz : array-like shape (N,3)
         array representing x,y,z of N points in a track
      p : array shape (3,)
         array representing an arbitrary point with x,y,z coordinates in
         space.
  
      Returns
      -------
      d : float
         a float number representing Euclidean distance
  
      Examples
      --------
      >>> import numpy as np
      >>> from dipy.tracking.metrics import midpoint2point, midpoint
      >>> theta=np.pi*np.linspace(0,1,100)
      >>> x=np.cos(theta)
      >>> y=np.sin(theta)
      >>> z=0*x
      >>> xyz=np.vstack((x,y,z)).T
      >>> dist=midpoint2point(xyz,np.array([0,0,0]))
  
      """
      mid = midpoint(xyz)
      return np.sqrt(np.sum((xyz - mid) ** 2))
  
imports: from dipy.utils.deprecator import deprecate_with_version
  from dipy.tracking.streamline import set_number_of_points
  import numpy
  from scipy.interpolate import splprep, splev
label_desc: Use image node_id 22 for calling a global function with example usage: midpoint2point(xyz, p) and returns: np