Class AnnotationGraph

java.lang.Object
org.jgrapht.graph.AbstractGraph<BrainAnnotation,AnnotationWeightedEdge>
org.jgrapht.graph.AbstractBaseGraph<BrainAnnotation,AnnotationWeightedEdge>
All Implemented Interfaces:
Serializable, Cloneable, org.jgrapht.Graph<BrainAnnotation,AnnotationWeightedEdge>

public class AnnotationGraph extends SNTGraph<BrainAnnotation,AnnotationWeightedEdge>
A specialized graph implementation for brain annotations that extends SNTGraph. This class provides functionality to create and analyze graphs based on brain annotations and their relationships, using different metrics for edge weighting.

The graph can be constructed using various metrics such as:

See Also:
  • Field Details

  • Constructor Details

    • AnnotationGraph

      protected AnnotationGraph()
      Protected default constructor for internal use.
    • AnnotationGraph

      public AnnotationGraph(Collection<Tree> trees, String metric, double threshold, int maxOntologyDepth)
      Constructs an annotation graph from a collection of trees using specified parameters.
      Parameters:
      trees - The collection of trees to analyze
      metric - The metric to use for graph construction (one of getMetrics())
      threshold - The threshold value for filtering connections
      maxOntologyDepth - The maximum depth to consider in the ontology hierarchy
    • AnnotationGraph

      public AnnotationGraph(Collection<Tree> trees, Collection<BrainAnnotation> annotations, String metric, double threshold)
      Constructs an annotation graph from trees and annotations with specified parameters.
      Parameters:
      trees - The collection of input trees to analyze
      annotations - The collection of brain annotations. Used as nodes
      metric - The metric to use for graph construction (one of getMetrics()). Used as edges
      threshold - The threshold value for filtering connections
    • AnnotationGraph

      public AnnotationGraph(Collection<Tree> trees, Collection<BrainAnnotation> annotations, String metric)
      Constructs an annotation graph from trees and annotations using a specified metric.
      Parameters:
      trees - The collection of trees to analyze
      annotations - The collection of brain annotations to consider
      metric - The metric to use for graph construction (one of getMetrics())
  • Method Details

    • getMetrics

      public static String[] getMetrics()
    • filterEdgesByWeight

      public void filterEdgesByWeight(int minWeight)
    • removeOrphans

      public Set<BrainAnnotation> removeOrphans()
    • sumEdgeWeights

      public double sumEdgeWeights()
      Gets the sum of all edge weights.
      Returns:
      the sum of all edge weights
    • getTrees

      public List<Tree> getTrees()
    • show

      protected void show()
      Displays this graph in a new instance of SNT's "Dendrogram Viewer".
    • getMaxOntologyDepth

      public int getMaxOntologyDepth()
    • getThreshold

      public double getThreshold()
    • getMetric

      public String getMetric()
    • main

      public static void main(String[] args)