tedana.metrics.collect.generate_metrics

generate_metrics(*, data_cat: ndarray[tuple[int, ...], dtype[_ScalarType_co]], data_optcom: ndarray[tuple[int, ...], dtype[_ScalarType_co]], mixing: ndarray[tuple[int, ...], dtype[_ScalarType_co]], adaptive_mask: ndarray[tuple[int, ...], dtype[_ScalarType_co]], tes: List[int] | List[float] | ndarray[tuple[int, ...], dtype[_ScalarType_co]], n_independent_echos: int | None = None, io_generator: OutputGenerator, label: str, external_regressors: DataFrame | None = None, external_regressor_config: List[Dict] | None = None, metrics: List[str] | None = None) Tuple[DataFrame, ndarray[tuple[int, ...], dtype[_ScalarType_co]]][source]

Fit TE-dependence and -independence models to components.

Parameters:
  • data_cat ((S x E x T) array_like) – Input data, where S is samples, E is echos, and T is time

  • data_optcom ((S x T) array_like) – Optimally combined data

  • mixing ((T x C) array_like) – Mixing matrix for converting input data to component space, where C is components and T is the same as in data_cat

  • adaptive_mask ((S) 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.

  • tes (list) – List of echo times associated with data_cat, in milliseconds

  • n_independent_echos (int) – Number of independent echoes to use in goodness of fit metrics (fstat). Primarily used for EPTI acquisitions. If None, number of echoes will be used. Default is None.

  • io_generator (tedana.io.OutputGenerator) – The output generator object for this workflow

  • label (str in [‘ICA’, ‘PCA’]) – The label for this metric generation type

  • external_regressors (None or pandas.DataFrame, optional) – External regressors (e.g., motion parameters, physiological noise) to correlate with ICA components. If None, no external regressor metrics will be calculated.

  • external_regressor_config (list[dic]t) – A list of dictionaries defining how to fit external regressors to component time series

  • metrics (list) – List of metrics to return

Returns:

  • component_table ((C x X) pandas.DataFrame) – Component metric table. One row for each component, with a column for each metric. The index is the component number.

  • mixing ((T x C) array_like) – Mixing matrix for converting input data to component space, where C is components and T is the same as in data_cat The signs of a component time series are flipped so that the components spatial map has more positive voxel weights