class_docstr: Points on the unit sphere.
  
  The sphere can be constructed using one of three conventions::
  
    Sphere(x, y, z)
    Sphere(xyz=xyz)
    Sphere(theta=theta, phi=phi)
  
  Parameters
  ----------
  x, y, z : 1-D array_like
      Vertices as x-y-z coordinates.
  theta, phi : 1-D array_like
      Vertices as spherical coordinates.  Theta and phi are the inclination
      and azimuth angles respectively.
  xyz : (N, 3) ndarray
      Vertices as x-y-z coordinates.
  faces : (N, 3) ndarray
      Indices into vertices that form triangular faces.  If unspecified,
      the faces are computed using a Delaunay triangulation.
  edges : (N, 2) ndarray
      Edges between vertices.  If unspecified, the edges are
      derived from the faces.
code: def __init__(
      self,
      x=None,
      y=None,
      z=None,
      theta=None,
      phi=None,
      xyz=None,
      faces=None,
      edges=None,
  ):
      all_specified = (
          _all_specified(x, y, z)
          + _all_specified(xyz)
          + _all_specified(theta, phi)
      )
      one_complete = (
          _some_specified(x, y, z)
          + _some_specified(xyz)
          + _some_specified(theta, phi)
      )
  
      if not (all_specified == 1 and one_complete == 1):
          raise ValueError(
              "Sphere must be constructed using either "
              "(x,y,z), (theta, phi) or xyz."
          )
  
      if edges is not None and faces is None:
          raise ValueError(
              "Either specify both faces and "
              "edges, only faces, or neither."
          )
  
      if edges is not None:
          self.edges = np.asarray(edges)
      if faces is not None:
          self.faces = np.asarray(faces)
  
      if theta is not None:
          self.theta = np.array(theta, copy=False, ndmin=1)
          self.phi = np.array(phi, copy=False, ndmin=1)
          return
  
      if xyz is not None:
          xyz = np.asarray(xyz)
          x, y, z = xyz.T
  
      x, y, z = (np.asarray(t) for t in (x, y, z))
      r, self.theta, self.phi = cart2sphere(x, y, z)
  
      if not np.allclose(r, 1):
          warnings.warn("Vertices are not on the unit sphere.")
  
imports: import numpy
  import warnings
  from scipy import optimize
  from dipy.core.geometry import cart2sphere, sphere2cart, vector_norm
  from dipy.core.onetime import auto_attr
  from dipy.reconst.recspeed import remove_similar_vertices
label_desc: Use image node_id 1 to create a new Sphere object  with example: obj = Sphere(x, y, z, theta, phi, xyz, faces, edges)