class_docstr: Class for the Free Water Elimination Diffusion Tensor Model 
docstr: Free Water Diffusion Tensor Model [1]_.
  
  Parameters
  ----------
  gtab : GradientTable class instance
  fit_method : str or callable
      str can be one of the following:
  
      'WLS' for weighted linear least square fit according to [1]_
          :func:`fwdti.wls_iter`
      'NLS' for non-linear least square fit according to [1]_
          :func:`fwdti.nls_iter`
  
      callable has to have the signature:
        fit_method(design_matrix, data, *args, **kwargs)
  args, kwargs : arguments and key-word arguments passed to the
     fit_method. See fwdti.wls_iter, fwdti.nls_iter for
     details
  
  References
  ----------
  .. [1] Henriques, R.N., Rokem, A., Garyfallidis, E., St-Jean, S.,
         Peterson E.T., Correia, M.M., 2017. [Re] Optimization of a free
         water elimination two-compartment model for diffusion tensor
         imaging. ReScience volume 3, issue 1, article number 2
docstr_tok: ["Free","Water","Diffusion","Tensor","Model","[","1","]","_.","Parameters","--","--","--","--","--","gtab",":","GradientTable","class","instance","fit_method",":","str","or","callable","str","can","be","one","of","the","following",":","'WLS","'","for","weighted","linear","least","square","fit","according","to","[","1","]","_",":","func",":","`","fwdti.wls_iter","`","'NLS","'","for","non-linear","least","square","fit","according","to","[","1","]","_",":","func",":","`","fwdti.nls_iter","`","callable","has","to","have","the","signature",":","fit_method","(","design_matrix",",","data",",","*","args",",","*","*","kwargs",")","args",",","kwargs",":","arguments","and","key-word","arguments","passed","to","the","fit_method",".","See","fwdti.wls_iter",",","fwdti.nls_iter","for","details","References","--","--","--","--","--","..","[","1","]","Henriques",",","R.N.",",","Rokem",",","A.",",","Garyfallidis",",","E.",",","St-Jean",",","S.",",","Peterson","E.T.",",","Correia",",","M.M.",",","2017",".","[","Re","]","Optimization","of","a","free","water","elimination","two-compartment","model","for","diffusion","tensor","imaging",".","ReScience","volume","3",",","issue","1",",","article","number","2"]
code: def __init__(self, gtab, fit_method="NLS", *args, **kwargs):
      """Free Water Diffusion Tensor Model [1]_.
  
      Parameters
      ----------
      gtab : GradientTable class instance
      fit_method : str or callable
          str can be one of the following:
  
          'WLS' for weighted linear least square fit according to [1]_
              :func:`fwdti.wls_iter`
          'NLS' for non-linear least square fit according to [1]_
              :func:`fwdti.nls_iter`
  
          callable has to have the signature:
            fit_method(design_matrix, data, *args, **kwargs)
      args, kwargs : arguments and key-word arguments passed to the
         fit_method. See fwdti.wls_iter, fwdti.nls_iter for
         details
  
      References
      ----------
      .. [1] Henriques, R.N., Rokem, A., Garyfallidis, E., St-Jean, S.,
             Peterson E.T., Correia, M.M., 2017. [Re] Optimization of a free
             water elimination two-compartment model for diffusion tensor
             imaging. ReScience volume 3, issue 1, article number 2
  
      """
      ReconstModel.__init__(self, gtab)
  
      if not callable(fit_method):
          try:
              fit_method = common_fit_methods[fit_method]
          except KeyError:
              e_s = '"' + str(fit_method) + '" is not a known fit '
              e_s += "method, the fit method should either be a "
              e_s += "function or one of the common fit methods"
              raise ValueError(e_s)
      self.fit_method = fit_method
      self.design_matrix = design_matrix(self.gtab)
      self.args = args
      self.kwargs = kwargs
  
      # Check if at least three b-values are given
      enough_b = check_multi_b(self.gtab, 3, non_zero=False)
      if not enough_b:
          mes = "fwDTI requires at least 3 b-values (which can include b=0)"
          raise ValueError(mes)
  
imports: import warnings
  import numpy
  import scipy.optimize
  from dipy.reconst.base import ReconstModel
  from dipy.reconst.dti import TensorFit, design_matrix, decompose_tensor, _decompose_tensor_nan, from_lower_triangular, lower_triangular
  from dipy.reconst.dki import _positive_evals
  from dipy.reconst.vec_val_sum import vec_val_vect
  from dipy.core.ndindex import ndindex
  from dipy.core.gradients import check_multi_b
  from dipy.reconst.multi_voxel import multi_voxel_fit
label_desc: Use image node_id 1 to create a new FreeWaterTensorModel object from inherited base classes: ReconstModel with example: obj = FreeWaterTensorModel(gtab, fit_method)