tedana.selection.selection_utils.comptable_classification_changer
- comptable_classification_changer(selector, boolstate, classify_if, decision_boolean, tag_if=None, dont_warn_reclassify=False)[source]
Implement the component classification changes from
change_comptable_classifications
.- Parameters:
selector (
tedana.selection.component_selector.ComponentSelector
) – The attributes used arecomponent_table_
,component_status_table_
, andcurrent_node_idx_
boolstate (
bool
) – Change classifications only for True or False components in decision_boolean based on this variableclassify_if (
str
) – This should be if_True or if_False to match boolstate. 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 (
str
) – This should be tag_if_true or tag_if_false to match boolstate 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
) – Operates on the True OR False components depending on boolstatecomponent_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.- Warns:
UserWarning – If a classification is changed away from accepted or rejected and dont_warn_reclassify is False, then a warning is logged
Note
This is designed to be run by
change_comptable_classifications()
. This function is run twice, ones for changes to make of a component is True and again for components that are False.