tract_querier.query_processor¶
Classes
This class implements the parser to process White Matter Query Language modules. |
|
|
Information about a processed query |
|
|
|
Functions
|
|
Exceptions
|
|
|
- class tract_querier.query_processor.EvaluateQueries(tractography_spatial_indexing)[source]¶
Bases:
NodeVisitorThis class implements the parser to process White Matter Query Language modules. By inheriting from
ast.NodeVisitorit uses a syntax close to the python language.Every node expression visitor has the following signature
- Parameters:
- nodeast.Node
Methods
generic_visit(node)Called if no explicit visitor function exists for a node.
process_assignment(node)Processes the assignment operations
process_relative_term(node)Processes the relative terms
rewrite_side_query(node)Processes the side suffixes in a query
visit(node)Visit a node.
visit_Assign
visit_Attribute
visit_AugAssign
visit_BinOp
visit_BoolOp
visit_Call
visit_Compare
visit_Constant
visit_Expr
visit_For
visit_Module
visit_Name
visit_UnaryOp
- Returns:
- tractsset
numbers of the tracts that result of this query
- labelsset
numbers of the labels that are traversed by the tracts resulting from this query
- relative_terms = ['anterior_of', 'posterior_of', 'medial_of', 'lateral_of', 'inferior_of', 'superior_of']¶
- process_relative_term(node)[source]¶
Processes the relative terms
anterior_of
posterior_of
superior_of
inferior_of
medial_of
lateral_of
- Parameters:
- node
ast.Node Parsed tree
- node
- Returns:
- tracts, labels
- tractsset
Numbers of the tracts that result of this query
- labelsset
Numbers of the labels that are traversed by the tracts resulting from this query
- process_assignment(node)[source]¶
Processes the assignment operations
- Parameters:
- node
ast.Node Parsed tree
- node
- Returns:
- queries_to_evaluate: dict
A dictionary or pairs ‘<name of the query>’= <node to evaluate>