docstr: Calculates the discrete ODF for a given discrete sphere.
          
docstr_tok: ["Calculates","the","discrete","ODF","for","a","given","discrete","sphere","."]
code: def odf(self, sphere):
      """Calculates the discrete ODF for a given discrete sphere."""
      self.gqi_vector = self.model.cache_get("gqi_vector", key=sphere)
      if self.gqi_vector is None:
          if self.model.method == "gqi2":
              H = squared_radial_component
              # print self.gqi_vector.shape
              self.gqi_vector = np.real(
                  H(
                      np.dot(self.model.b_vector, sphere.vertices.T)
                      * self.model.Lambda
                  )
              )
          if self.model.method == "standard":
              self.gqi_vector = np.real(
                  np.sinc(
                      np.dot(self.model.b_vector, sphere.vertices.T)
                      * self.model.Lambda
                      / np.pi
                  )
              )
          self.model.cache_set("gqi_vector", sphere, self.gqi_vector)
  
      return np.dot(self.data, self.gqi_vector)
  
imports: import numpy
  from dipy.reconst.odf import OdfModel, OdfFit
  from dipy.reconst.cache import Cache
  import warnings
  from dipy.reconst.multi_voxel import multi_voxel_fit
label_desc: Use image node_id 2 for calling the GeneralizedQSamplingFit obj's underlying member method code with example usage: obj.odf(sphere) and returns: np