code: def get_fitted_tensor(
      self,
      data,
      mask,
      bval,
      bvec,
      b0_threshold=50,
      bvecs_tol=0.01,
      fit_method="WLS",
      optional_args=None,
  ):
      logging.info("Tensor estimation...")
      bvals, bvecs = read_bvals_bvecs(bval, bvec)
      gtab = gradient_table(
          bvals, bvecs, b0_threshold=b0_threshold, atol=bvecs_tol
      )
  
      tenmodel = TensorModel(
          gtab, fit_method=fit_method, **optional_args
      )
      tenfit = tenmodel.fit(data, mask)
  
      return tenfit, gtab
  
imports: import logging
  import numpy
  import os.path
  from ast import literal_eval
  from warnings import warn
  import nibabel
  from dipy.core.gradients import mask_non_weighted_bvals, gradient_table
  from dipy.data import default_sphere, get_sphere
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.io.peaks import save_peaks, peaks_to_niftis
  from dipy.io.image import load_nifti, save_nifti, load_nifti_data
  from dipy.io.utils import nifti1_symmat
  from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel, auto_response_ssst
  from dipy.reconst.dti import TensorModel, color_fa, fractional_anisotropy, geodesic_anisotropy, mean_diffusivity, axial_diffusivity, radial_diffusivity, lower_triangular, mode
  from dipy.direction.peaks import peaks_from_model
  from dipy.reconst.shm import CsaOdfModel
  from dipy.workflows.workflow import Workflow
  from dipy.reconst.dki import DiffusionKurtosisModel, split_dki_param
  from dipy.reconst.ivim import IvimModel
  from dipy.reconst.rumba import RumbaSDModel
  from dipy.reconst import mapmri
  from dipy.utils.deprecator import deprecated_params
label_desc: Use image node_id 3 for calling the ReconstDtiFlow obj's underlying member method code with example usage: obj.get_fitted_tensor(data, mask, bval, bvec, b0_threshold, bvecs_tol, fit_method, optional_args) and returns: tenfit,  gtab