tedana.selection.selection_nodes.dec_classification_doesnt_exist

dec_classification_doesnt_exist(selector, new_classification, decide_comps, class_comp_exists, at_least_num_exist=1, log_extra_info='', custom_node_label='', only_used_metrics=False, tag=None)[source]

Change the classification of all components in decide_comps.

This is done if there are no components with a classification specified in class_comp_exists.

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

  • new_classification (str) – Assign all components identified in decide_comps the classification in new_classification.

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

  • class_comp_exists (str or list[str] or int or list[int]) – This has the same structure options as decide_comps. This function tests whether any components in decide_comps have the classifications defined in this variable.

  • at_least_num_exist (int) – Instead of just testing whether a classification exists, test whether at least this number of components have that classification. Default=1

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

  • 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. Default=””.

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 function is useful to end the component selection process early even if there are additional nodes. For example, in the original kundu tree, if 0 or 1 components are identified with kappa>elbow and rho>elbow then, instead of removing everything, it effectively says something’s wrong and conservatively keeps everything. Similarly, later in the kundu tree, there are several steps deciding how to classify any remaining provisional components. If none of the remaining components are “provisionalreject” then it skips those steps and accepts everything left.