tedana.selection.selection_nodes.calc_varex_thresh

calc_varex_thresh(selector, decide_comps, thresh_label, percentile_thresh, num_highest_var_comps=None, log_extra_info='', custom_node_label='', only_used_metrics=False)[source]

Calculate the variance explained threshold to use in the kundu decision tree.

Will save a high or low percentile threshold depending on highlow_thresh

Parameters:
  • selector (ComponentSelector) – If only_used_metrics is False, the updated selector is returned.

  • decide_comps (str or list[str]) – What classification(s) to operate on. using default or intermediate_classification labels. For example: decide_comps=’unclassified’ means to operate only on unclassified components. Use ‘all’ to include all components.

  • thresh_label (str) – The threshold will be saved in “varex_(thresh_label)_thresh” In the original kundu decision tree this was either “upper” or “lower” If passed an empty string, will be saved as “varex_thresh”

  • percentile_thresh (int) – A percentile threshold to apply to components to set the variance threshold. In the original kundu decision tree this was 90 for varex_upper_thresh and 25 for varex_lower_thresh

  • num_highest_var_comps (str int) – percentile can be calculated on the num_highest_var_comps components with the lowest variance. Either input an integer directly or input a string that is a parameter stored in selector.cross_component_metrics_ (“num_acc_guess” in original decision tree). Default=None

  • log_extra_info (str) – Additional text to the information log. Default=””.

  • custom_node_label (str) – A short label to describe what happens in this step. If “” then a label is automatically generated. Default=””.

  • only_used_metrics (bool) – If True, only return the component_table metrics that would be used. Default=False.

Returns:

  • selector (ComponentSelector) – If only_used_metrics is False, the updated selector is returned.

  • used_metrics (set(str)) – If only_used_metrics is True, the names of the metrics used in the function are returned.