code: def principal_components(xyz):
      """We use PCA to calculate the 3 principal directions for a track
  
      Parameters
      ----------
      xyz : array-like shape (N,3)
         array representing x,y,z of N points in a track
  
      Returns
      -------
      va : array_like
          eigenvalues
      ve : array_like
          eigenvectors
  
      Examples
      --------
      >>> import numpy as np
      >>> from dipy.tracking.metrics import principal_components
      >>> 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
      >>> va, ve = principal_components(xyz)
      >>> np.allclose(va, [0.51010101, 0.09883545, 0])
      True
      """
      C = np.cov(xyz.T)
      va, ve = np.linalg.eig(C)
      return va, ve
  
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 21 for calling a global function with example usage: principal_components(xyz) and returns: va,  ve