tedana.selection.selection_utils.rho_elbow_kundu_liberal

rho_elbow_kundu_liberal(component_table, n_echos, rho_elbow_type='kundu', comps2use=None, subset_comps2use=-1)[source]

Calculate an elbow for rho.

Uses the approach originally in Prantik Kundu’s MEICA v2.5 code and with a slightly more liberal threshold.

Parameters:
  • component_table ((C x M) pandas.DataFrame) – Component metric table. One row for each component, with a column for each metric. The index should be the component number. Only the ‘kappa’ column is used in this function

  • n_echos (int) – The number of echos in the multi-echo data

  • rho_elbow_type (str) – The algorithm used to calculate the rho elbow. Current options are ‘kundu’ and ‘liberal’.

  • comps2use (list[int]) – A list of component indices used to calculate the elbow default=None which means use all components

  • subset_comps2use (list[int]) – A list of component indices used to calculate the elbow If None then only calculate a threshold using all components default=-1 which means use only ‘unclassified’ components

Returns:

  • rho_elbow (float) – The ‘elbow’ value for rho values, above which components are considered more likely to contain S0 weighted signals

  • rho_allcomps_elbow (float) – rho elbow calculated using all components in comps2use

  • rho_unclassified_elbow (float) – rho elbow clculated using all components in subset_comps2use None if subset_comps2use is None

  • elbow_f05 (float) – A significant threshold based on the number of echoes. Used as part of the mean for rho_elbow_type==’kundu’

Note

The rho elbow calculation in Kundu’s original meica code calculates one elbow using all components’ rho values, one elbow using only unclassified components (excluding 2-3 remaining high variance componetns), on threshold based on the number of echos, and takes the mean of those 3 values To replicate the original code, comps2use should include indices for all components and subset_comps2use should includes indices for unclassified components

Also, in practice, one of these elbows is sometimes extremely low and the mean creates an overly agressive rho threshold (values >rho_elbow are more likely rejected). The liberal threshold option takes the max of the two elbows based on rho values. The assumption is that the threshold on unclassified components is always lower and can likely be excluded. Both rho elbows are now logged so that it will be possible to confirm this with data & make additional adjustments to this threshold.

Additionally, the liberal threshold does not exclude 2-3 high variance components from the unclassified threshold. This was done as a practical matter because those components are now removed in a separate node, dec_reclassify_high_var_comps, and adding that separate node to the minimal tree would make it less minimal, but it also seems reasonable since there was no clear reason why they elbow with them removed was reliably better than the elbow containing them. More direct comparisons between these two arbitrary thresholds might be useful at some point.