Package sc.fiji.snt.analysis.graph
Class AnnotationGraph
java.lang.Object
org.jgrapht.graph.AbstractGraph<BrainAnnotation,AnnotationWeightedEdge>
org.jgrapht.graph.AbstractBaseGraph<BrainAnnotation,AnnotationWeightedEdge>
sc.fiji.snt.analysis.graph.SNTGraph<BrainAnnotation,AnnotationWeightedEdge>
sc.fiji.snt.analysis.graph.AnnotationGraph
- All Implemented Interfaces:
Serializable,Cloneable,org.jgrapht.Graph<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:
- Number of tips (
TIPS) - Total length (
LENGTH) - Number of branch points (
BRANCH_POINTS) - Edge count (
EDGES)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.jgrapht.Graph
DEFAULT_EDGE_WEIGHT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected default constructor for internal use.AnnotationGraph(Collection<Tree> trees, String metric, double threshold, int maxOntologyDepth) Constructs an annotation graph from a collection of trees using specified parameters.AnnotationGraph(Collection<Tree> trees, Collection<BrainAnnotation> annotations, String metric) Constructs an annotation graph from trees and annotations using a specified metric.AnnotationGraph(Collection<Tree> trees, Collection<BrainAnnotation> annotations, String metric, double threshold) Constructs an annotation graph from trees and annotations with specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidfilterEdgesByWeight(int minWeight) intstatic String[]doublegetTrees()static voidprotected voidshow()Displays this graph in a new instance of SNT's "Dendrogram Viewer".doubleGets the sum of all edge weights.Methods inherited from class sc.fiji.snt.analysis.graph.SNTGraph
applyEdges, applyVertices, filterEdges, filterVertices, getEdgeColor, getEdgeColorRGBMap, getVertexColor, getVertexColorRGBMap, getVertexValue, getVertexValueMap, setEdgeColor, setVertexColor, setVertexValueMethods inherited from class org.jgrapht.graph.AbstractBaseGraph
addEdge, addEdge, addVertex, addVertex, clone, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeSource, getEdgeSupplier, getEdgeTarget, getEdgeWeight, getType, getVertexSupplier, incomingEdgesOf, inDegreeOf, iterables, outDegreeOf, outgoingEdgesOf, removeEdge, removeEdge, removeVertex, setEdgeSupplier, setEdgeWeight, setVertexSupplier, vertexSetMethods inherited from class org.jgrapht.graph.AbstractGraph
assertVertexExist, containsEdge, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSetsMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapht.Graph
containsEdge, removeAllEdges, removeAllEdges, removeAllVertices, setEdgeWeight
-
Field Details
-
TIPS
- See Also:
-
LENGTH
- See Also:
-
BRANCH_POINTS
- See Also:
-
EDGES
- See Also:
-
-
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 analyzemetric- The metric to use for graph construction (one ofgetMetrics())threshold- The threshold value for filtering connectionsmaxOntologyDepth- 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 analyzeannotations- The collection of brain annotations. Used as nodesmetric- The metric to use for graph construction (one ofgetMetrics()). Used as edgesthreshold- 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 analyzeannotations- The collection of brain annotations to considermetric- The metric to use for graph construction (one ofgetMetrics())
-
-
Method Details
-
getMetrics
-
filterEdgesByWeight
public void filterEdgesByWeight(int minWeight) -
removeOrphans
-
sumEdgeWeights
public double sumEdgeWeights()Gets the sum of all edge weights.- Returns:
- the sum of all edge weights
-
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
-
main
-