Skip to content

filters

ConnectedComponentFilter

Bases: GraphFilter

The ConnectedComponentFilter filters out all connections that are not part of the largest weakly connected component. If this filter is used, only one strongly connected component remains.

filter(graph) staticmethod

Filter connections that are not part of the largest weakly connected component.

Parameters:

Name Type Description Default
graph Graph

Dgm graph object.

required

Returns:

Name Type Description
Graph Graph

Dgm graph object.

CorrelationFilter

Bases: WeightFilter

filter(graph) staticmethod

CvFilter

Bases: GraphFilter

Filter out connections that do not fall within the range [cv_min, cv_max].

Data about connected/disconnected edges due to the CV check is stored as cv_mask (boolean array) in the graph as a part of DirectedMask object.

filter(graph) staticmethod

Apply CVGraphFilter to filters connections that do not fall within the conduction velocity range [cv_min, cv_max].

Parameters:

Name Type Description Default
graph Graph

DGM graph object.

required

Returns:

Name Type Description
Graph Graph

DGM graph object.

DeltaLatFilter

Bases: WeightFilter

filter(graph) staticmethod

DigonFilter

Bases: GraphFilter

Filters the edges that are connected in both directions.

filter(graph) staticmethod

Filter out edges that are connected in both directions by keeping the arrow with the highest non-negative conduction velocity. The highest CV is equal to the edge with the smallest weight (usually Delta LAT) as distance is constant.

Parameters:

Name Type Description Default
graph Graph

Dgm graph object.

required

Returns:

Name Type Description
Graph Graph

Dgm graph object.

EdgeLengthFilter

Bases: GraphFilter

Filter out connections that are shorter than the minimum edge length and longer than the maximum edge length. If either the upper or lower bound is missing, then this will be -inf or inf respectively.

filter(graph) staticmethod

Apply an upper and lower bound edge length filter. If either the upper or lower bound is None, then it will skip said bound.

Parameters:

Name Type Description Default
graph Graph

Dgm graph object.

required

Returns:

Name Type Description
Graph Graph

Dgm graph object.