tedana.selection.selection_utils.change_comptable_classifications
- change_comptable_classifications(selector, if_true, if_false, decision_boolean, tag_if_true=None, tag_if_false=None, dont_warn_reclassify=False)[source]
Change or don’t change the component classification.
This happens based on the information on whether a decision critereon is true or false for each component.
- Parameters:
selector (
tedana.selection.component_selector.ComponentSelector
) – The attributes used arecomponent_table_
,component_status_table_
, andcurrent_node_idx_
if_true, if_false (
str
) – If the condition in this step is true or false, give the component the label in this string. Options are ‘accepted’, ‘rejected’, ‘nochange’, or intermediate_classification labels predefined in the decision tree. If ‘nochange’ then don’t change the current component classificationdecision_boolean (
pd.Series(bool)
) – A dataframe column of equal length to component_table where each value is True or False.tag_if_true, tag_if_false (
str
) – A string containing a label in classification_tags that will be added to the classification_tags column in component_table if a component is classified as true or false. default=Nonedont_warn_reclassify (
bool
) – If this function changes a component classification from accepted or rejected to something else, it gives a warning. If this is True, that warning is suppressed. default=False
- Returns:
selector (
tedana.selection.component_selector.ComponentSelector
) –component_table_["classifications"]
will reflect any new classifications.component_status_table_
will have a new column titled “Nodecurrent_node_idx_
” that is a copy of the updated classifications column.component_table_["classification_tags"]
will be updated to include any new tags. Each tag should appear only once in the string and tags will be separated by commas.n_true, n_false (
int
) – The number of True and False components in decision_boolean
Note
If a classification is changed away from accepted or rejected and dont_warn_reclassify is False, then a warning is logged