class_docstr: A tree choice chooses one path to a leaf in a tree
  
  Trees are represented as collections of two-tuples. The first element is
  the name of the node and the second is either None if a leaf or
  a sub-collection of two-tuples. For instance:
  (("Foo", (("1", None),("2", None))), ("Bar", None))
  is a tree for selecting ("Foo", "1"), ("Foo", "2") or ("Bar",).
  
  A good UI choice would be a hierarchical menu.
docstr: Get the leaf node of the tree for the current setting value
docstr_tok: ["Get","the","leaf","node","of","the","tree","for","the","current","setting","value"]
code: def get_selected_leaf(self):
      """Get the leaf node of the tree for the current setting value"""
      tree = self.get_tree()
      node = None
      for item in self.get_path_parts():
          nodes = [n for n in tree if n[0] == item]
          if len(nodes) != 1:
              raise ValidationError(
                  "Unable to find command "
                  + ">".join(self.get_path_parts()),
                  self,
              )
          node = nodes[0]
          tree = node[1]
      return node
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/setting/_tree_choice.py
imports: import re
  from ._setting import Setting
  from ._validation_error import ValidationError
label_desc: Use image node_id 7 for calling the TreeChoice obj's underlying member method code with example usage: obj.get_selected_leaf() and returns: node