tedana.decay.fit_decay

fit_decay(data, tes, adaptive_mask, fittype, report=True, n_threads=1, backend='cpu', t2s_initial=None, s0_initial=None, voxels_to_refit=None)[source]

Fit voxel-wise monoexponential decay models to data.

Parameters:
  • data ((Md x E [x T]) array_like) – Multi-echo data array, where M is samples in denoising mask, E is echos, and T is time.

  • tes ((E,) list) – Echo times in seconds.

  • adaptive_mask ((Md,) array_like) – Array where each value indicates the number of echoes with good signal for that voxel. This mask may be thresholded; for example, with values less than 3 set to 0. For more information on thresholding, see make_adaptive_mask.

  • fittype ({loglin, curvefit}) – The type of model fit to use

  • report (bool, optional) – Whether to log a description of this step or not. Default is True.

  • n_threads (int, optional) – Number of threads to use. Default is 1. If None or <= 0, uses the number of available CPU cores.

  • backend ({“cpu”, “cuda”, “auto”}, optional) – Compute backend for curve fitting. Default is cpu.

  • t2s_initial ((Md,) numpy.ndarray or None, optional) – Initial T2* estimates for curvefit. If None, log-linear estimates are used.

  • s0_initial ((Md,) numpy.ndarray or None, optional) – Initial S0 estimates for curvefit. If None, log-linear estimates are used.

  • voxels_to_refit ((Md,) numpy.ndarray or None, optional) – Boolean array indicating which voxels to refit. If None, all voxels are fitted.

Returns:

  • t2s ((Md,) numpy.ndarray) – “Full” T2* map without floors or ceilings applied. This includes T2* estimates for all voxels with adaptive mask >= 1. Voxels with adaptive mask == 1 have T2* estimates from the first two echoes.

  • s0 ((Md,) numpy.ndarray) – “Full” S0 map without floors or ceilings applied. This includes S0 estimates for all voxels with adaptive mask >= 1. Voxels with adaptive mask == 1 have S0 estimates from the first two echoes.

  • failures ((Md,) numpy.ndarray or None) – Boolean array indicating samples that failed to fit the model. None if fittype is not “curvefit”.

  • t2s_var ((Md,) numpy.ndarray or None) – Variance of the T2* estimates. None if fittype is not “curvefit”.

  • s0_var ((Md,) numpy.ndarray or None) – Variance of the S0 estimates. None if fittype is not “curvefit”.

  • t2s_s0_covar ((Md,) numpy.ndarray or None) – Covariance of the T2* and S0 estimates. None if fittype is not “curvefit”.

See also

tedana.utils.make_adaptive_mask()

The function used to create the adaptive_mask parameter.