Package sc.fiji.snt.analysis.graph
Class DirectedWeightedSubgraph
java.lang.Object
org.jgrapht.graph.AbstractGraph<SWCPoint,SWCWeightedEdge>
org.jgrapht.graph.AsSubgraph<SWCPoint,SWCWeightedEdge>
sc.fiji.snt.analysis.graph.DirectedWeightedSubgraph
- All Implemented Interfaces:
Serializable,org.jgrapht.Graph<SWCPoint,SWCWeightedEdge>
public class DirectedWeightedSubgraph
extends org.jgrapht.graph.AsSubgraph<SWCPoint,SWCWeightedEdge>
Class for accessing the sub-graph that has a subset of vertices and a subset
of edges of a
DirectedWeightedGraph.- Author:
- Tiago Ferreira, Cameron Arshadi
- See Also:
-
Field Summary
Fields inherited from class org.jgrapht.graph.AsSubgraph
base, baseType, edgeSet, isInduced, vertexSetFields inherited from interface org.jgrapht.Graph
DEFAULT_EDGE_WEIGHT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDirectedWeightedSubgraph(DirectedWeightedGraph graph, Set<SWCPoint> nodeSubset) Creates a subgraph from a sub-set of nodes. -
Method Summary
Modifier and TypeMethodDescriptiongetBPs()Gets the branch points (junctions) of the graph.org.jgrapht.traverse.DepthFirstIterator<SWCPoint, SWCWeightedEdge> org.jgrapht.traverse.DepthFirstIterator<SWCPoint, SWCWeightedEdge> getDepthFirstIterator(SWCPoint startVertex) getLabel()Returns the label identifying this subgraph.getNodeStatistics(String type) getRoot()Gets the root of this graph.getTips()Gets the end points (tips) of the subgraph.getTree()Returns the tree associated with the parent's graphvoidSets an identifying label for this subgraph.voidSets the root of the tree.show()Displays this graph in a new instance of SNT's "Dendrogram Viewer".doublesumEdgeWeights(boolean adjusted) Gets the sum of all edge weights.Methods inherited from class org.jgrapht.graph.AsSubgraph
addEdge, addEdge, addVertex, addVertex, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeSource, getEdgeSupplier, getEdgeTarget, getEdgeWeight, getType, getVertexSupplier, incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf, removeEdge, removeEdge, removeVertex, setEdgeWeight, vertexSetMethods inherited from class org.jgrapht.graph.AbstractGraph
assertVertexExist, containsEdge, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSetsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapht.Graph
iterables, setEdgeWeight
-
Constructor Details
-
DirectedWeightedSubgraph
Creates a subgraph from a sub-set of nodes.- Parameters:
graph- the graph from whichnodeSubsetwere extracted.nodeSubset- the sub-set of nodes that define the sub-graph.
-
-
Method Details
-
setRoot
Sets the root of the tree. This modifies the edge directions such that all other nodes in the graph have the new root as ancestor.- Parameters:
newRoot- the new root of the tree, which must be an existing vertex of the graph- Throws:
IllegalArgumentException- if the graph does not contain newRoot
-
sumEdgeWeights
public double sumEdgeWeights(boolean adjusted) Gets the sum of all edge weights.- Parameters:
adjusted- whether edges of parent graph should be taken into account- Returns:
- the sum of all edge weights
-
getDepthFirstIterator
-
getDepthFirstIterator
public org.jgrapht.traverse.DepthFirstIterator<SWCPoint,SWCWeightedEdge> getDepthFirstIterator(SWCPoint startVertex) -
getBPs
Gets the branch points (junctions) of the graph.- Returns:
- the list of branch points
-
getTips
Gets the end points (tips) of the subgraph.- Returns:
- the list of end points
-
getRoot
Gets the root of this graph.- Returns:
- the root node.
-
getNodeStatistics
-
getTree
Returns the tree associated with the parent's graph- Returns:
- the associated tree
-
show
Displays this graph in a new instance of SNT's "Dendrogram Viewer".- Returns:
- a reference to the displayed window.
-
setLabel
Sets an identifying label for this subgraph.- Parameters:
label- the identifying string
-
getLabel
Returns the label identifying this subgraph.- Returns:
- the label (or null) if none has been set.
-