tedana.selection.selection_nodes.manual_classify

manual_classify(selector, decide_comps, new_classification, clear_classification_tags=False, log_extra_info='', custom_node_label='', only_used_metrics=False, tag=None, dont_warn_reclassify=False)[source]

Assign a classification defined in new_classification to the components in decide_comps.

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.

  • new_classification (str) – Assign all components identified in decide_comps the classification in new_classification. Options are ‘unclassified’, ‘accepted’, ‘rejected’, or intermediate_classification labels predefined in the decision tree

  • clear_classification_tags (bool) – If True, reset all values in the ‘classification_tags’ column to empty strings. This also can create the classification_tags column if it does not already exist. If False, do nothing.

  • tag (str) – A classification tag to assign to all components being reclassified. This should be one of the tags defined by classification_tags in the decision tree specification

  • dont_warn_reclassify (bool) – By default, if this function changes a component classification from accepted or rejected to something else, it gives a warning, since those should be terminal classifications. If this is True, that warning is suppressed. (Useful if manual_classify is used to reset all labels to unclassified). Default=False

  • 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.

Note

This was designed with three use cases in mind: (1) Set the classifications of all components to unclassified for the first node of a decision tree. clear_classification_tags=True is recommended for this use case. (2) Shift all components between classifications, such as provisionalaccept to accepted for the penultimate node in the decision tree. (3) Manually re-classify components by number based on user observations.

Unlike other decision node functions, if_true and if_false are not inputs since the same classification is assigned to all components listed in decide_comps.