tract_querier.query_processor¶
Classes
tract_querier.query_processor.DocStringInheritor |
A variation on |
tract_querier.query_processor.EndpointQueryInfo |
|
tract_querier.query_processor.EvaluateQueries |
This class implements the parser to process White Matter Query Language modules. |
tract_querier.query_processor.FiberQueryInfo([...]) |
Information about a processed query |
tract_querier.query_processor.RewriteChangeNotInPrescedence |
Methods |
tract_querier.query_processor.RewritePreprocess(...) |
Methods |
tract_querier.query_processor.takewhile |
takewhile(predicate, iterable) –> takewhile object |
Functions
tract_querier.query_processor.deepcopy(x[, ...]) |
Deep copy operation on arbitrary Python objects. |
tract_querier.query_processor.eval_queries(...) |
|
tract_querier.query_processor.gt |
gt(a, b) – Same as a>b. |
tract_querier.query_processor.labels_for_tracts(...) |
|
tract_querier.query_processor.lt |
lt(a, b) – Same as a<b. |
tract_querier.query_processor.queries_preprocess(...) |
|
tract_querier.query_processor.queries_syntax_check(...) |
Exceptions
tract_querier.query_processor.TractQuerierSyntaxError(value) |
-
class
tract_querier.query_processor.EvaluateQueries[source]¶ Bases:
ast.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: node : ast.Node
Returns: tracts : set
numbers of the tracts that result of this query
labels : set
numbers of the labels that are traversed by the tracts resulting from this query
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(node)visit_Attribute(node)visit_AugAssign(node)visit_BinOp(node)visit_BoolOp(node)visit_Call(node)visit_Compare(node)visit_Expr(node)visit_For(node)visit_Module(node)visit_Name(node)visit_Num(node)visit_Str(node)visit_UnaryOp(node)-
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.NodeParsed tree
Returns: tracts, labels
tracts : set
Numbers of the tracts that result of this query
labels : set
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.NodeParsed tree
Returns: queries_to_evaluate: dict
A dictionary or pairs ‘<name of the query>’= <node to evaluate>
-
-
exception
tract_querier.query_processor.TractQuerierSyntaxError(value)[source]¶ Bases:
exceptions.ValueError
-
exception
tract_querier.query_processor.TractQuerierLabelNotFound(value)[source]¶ Bases:
exceptions.ValueError