tedana.metrics.external.validate_extern_regress

validate_extern_regress(*, external_regressors: DataFrame, external_regressor_config: List[Dict], n_vols: int, dummy_scans: int) List[Dict][source]

Confirm external regressor dictionary matches data and expands regular expressions.

Most keys in external_regressor_config are valided in component_selector.validate_tree which is run when a component selector object is initialized. This function validates external_regressor_config against the dataset-specific external_regressors time series. If the config names specific column labels with the f_stats_partial_models key, then this confirms those column labels are used in external_regressors Also checks if the number of time points in the external regressors matches the number of time point in the fMRI data.

Parameters:
  • external_regressors (pandas.DataFrame) – Each column is a labelled regressor and the number of rows should match the number of timepoints in the fMRI time series

  • external_regressor_config (list[dict]) – Information describing the external regressors and method to use for fitting and statistical tests. Each element in the list is a dict defining the regressors and statistical models for a test.

  • n_vols (int) – The number of time points in the fMRI time series.

  • dummy_scans (int) – The number of dummy scans in the fMRI time series.

Returns:

external_regressor_config (list[dict]) – A validated list of dictionaries with info for fitting external regressors to component time series. If regex patterns like ‘^mot_.*$’ are used to define regressor names, these are replaced with a list of the matching column names used in external_regressors

Raises:

RegressorError if any validation test fails