docstr: Fit QTI to data.
  
  Parameters
  ----------
  data : numpy.ndarray
      Array of shape (..., number of acquisitions).
  mask : numpy.ndarray, optional
      Array with the same shape as the data array of a single acquisition.
  
  Returns
  -------
  qtifit : dipy.reconst.qti.QtiFit
      The fitted model.
docstr_tok: ["Fit","QTI","to","data",".","Parameters","--","--","--","--","--","data",":","numpy.ndarray","Array","of","shape","(","...",",","number","of","acquisitions",")",".","mask",":","numpy.ndarray",",","optional","Array","with","the","same","shape","as","the","data","array","of","a","single","acquisition",".","Returns","--","--","--","-","qtifit",":","dipy.reconst.qti.QtiFit","The","fitted","model","."]
code: def fit(self, data, mask=None):
      """Fit QTI to data.
  
      Parameters
      ----------
      data : numpy.ndarray
          Array of shape (..., number of acquisitions).
      mask : numpy.ndarray, optional
          Array with the same shape as the data array of a single acquisition.
  
      Returns
      -------
      qtifit : dipy.reconst.qti.QtiFit
          The fitted model.
      """
      if mask is None:
          mask = np.ones(data.shape[:-1], dtype=bool)
      else:
          if mask.shape != data.shape[:-1]:
              raise ValueError("Mask is not the same shape as data.")
          mask = np.array(mask, dtype=bool, copy=False)
      if self.fit_method_name == "SDPdc":
          params = self.fit_method(
              data, mask, self.X, self.cvxpy_solver
          )
      else:
          params = self.fit_method(data, mask, self.X)
      return QtiFit(params)
  
imports: from warnings import warn
  import numpy
  from dipy.reconst.base import ReconstModel
  from dipy.reconst.dti import auto_attr
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 2 for calling the QtiModel obj's underlying member method code with example usage: obj.fit(data, mask) and returns: QtiFit