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, vertexSet

    Fields inherited from interface org.jgrapht.Graph

    DEFAULT_EDGE_WEIGHT
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a subgraph from a sub-set of nodes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the branch points (junctions) of the graph.
    org.jgrapht.traverse.DepthFirstIterator<SWCPoint,SWCWeightedEdge>
     
    org.jgrapht.traverse.DepthFirstIterator<SWCPoint,SWCWeightedEdge>
     
    Returns the label identifying this subgraph.
     
    Gets the root of this graph.
    Gets the end points (tips) of the subgraph.
    Returns the tree associated with the parent's graph
    void
    Sets an identifying label for this subgraph.
    void
    setRoot(SWCPoint newRoot)
    Sets the root of the tree.
    Displays this graph in a new instance of SNT's "Dendrogram Viewer".
    double
    sumEdgeWeights(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, vertexSet

    Methods inherited from class org.jgrapht.graph.AbstractGraph

    assertVertexExist, containsEdge, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSets

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jgrapht.Graph

    iterables, setEdgeWeight
  • Constructor Details

    • DirectedWeightedSubgraph

      protected DirectedWeightedSubgraph(DirectedWeightedGraph graph, Set<SWCPoint> nodeSubset)
      Creates a subgraph from a sub-set of nodes.
      Parameters:
      graph - the graph from which nodeSubset were extracted.
      nodeSubset - the sub-set of nodes that define the sub-graph.
  • Method Details

    • setRoot

      public void setRoot(SWCPoint newRoot)
      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

      public org.jgrapht.traverse.DepthFirstIterator<SWCPoint,SWCWeightedEdge> getDepthFirstIterator()
    • getDepthFirstIterator

      public org.jgrapht.traverse.DepthFirstIterator<SWCPoint,SWCWeightedEdge> getDepthFirstIterator(SWCPoint startVertex)
    • getBPs

      public List<SWCPoint> getBPs()
      Gets the branch points (junctions) of the graph.
      Returns:
      the list of branch points
    • getTips

      public List<SWCPoint> getTips()
      Gets the end points (tips) of the subgraph.
      Returns:
      the list of end points
    • getRoot

      public SWCPoint getRoot()
      Gets the root of this graph.
      Returns:
      the root node.
    • getNodeStatistics

      public NodeStatistics<SWCPoint> getNodeStatistics(String type)
    • getTree

      public Tree getTree()
      Returns the tree associated with the parent's graph
      Returns:
      the associated tree
    • show

      public Window show()
      Displays this graph in a new instance of SNT's "Dendrogram Viewer".
      Returns:
      a reference to the displayed window.
    • setLabel

      public void setLabel(String label)
      Sets an identifying label for this subgraph.
      Parameters:
      label - the identifying string
    • getLabel

      public String getLabel()
      Returns the label identifying this subgraph.
      Returns:
      the label (or null) if none has been set.