Package sc.fiji.snt.analysis
Class StrahlerAnalyzer
java.lang.Object
sc.fiji.snt.analysis.StrahlerAnalyzer
Class to perform Horton-Strahler analysis on a
Tree.- Author:
- Tiago Ferreira
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclassify(DirectedWeightedGraph graph, boolean reverseOrder) voiddispose()Clears internal caches and mappings to free memory.doubledoublegetAvgExtensionAngle(boolean relative, int order) Gets the average relative extension angle for branches of a specific Strahler order.getAvgExtensionAngles(boolean relative) Gets a map of average relative extension angles for all Strahler orders.getBranches(int order) getExtensionAngles(boolean relative) Gets a map of relative extension angles for all branches in each Strahler order.getGraph()intgetNodes()doublegetRelativeExtensionAngle(Path branch) Computes the relative extension angle for a StrahlerAnalyzer branch by finding the parent direction from the graph structure.intstatic void
-
Constructor Details
-
StrahlerAnalyzer
-
-
Method Details
-
getGraph
- Returns:
- the graph of the tree being parsed.
-
getRootNumber
public int getRootNumber()- Returns:
- the highest Horton-Strahler number in the parsed tree.
-
getHighestBranchOrder
public int getHighestBranchOrder()- Returns:
- the highest Horton-Strahler number associated with a branch in the
parsed tree. Either
getRootNumber()orgetRootNumber()-1.
-
getLengths
- Returns:
- the map containing the cable lengh associated to each order ( Horton-Strahler numbers as key and cable length as value).
-
getAvgFragmentations
-
getAvgContractions
-
getBranchCounts
- Returns:
- the map containing the number of branches on each order (Horton-Strahler numbers as key and branch count as value).
-
getBranchPointCounts
- Returns:
- the map containing the number of branch points on each order (Horton-Strahler numbers as key and branch points count as value).
-
getBranches
- Returns:
- the map containing the list of branches on each order (Horton-Strahler numbers as key and branch points count as value).
-
getBranches
- Throws:
IllegalArgumentException
-
getRootAssociatedBranches
-
getBifurcationRatios
- Returns:
- the map containing the bifurcation ratios obtained as the ratio of no. of branches between consecutive orders (Horton-Strahler numbers as key and ratios as value).
-
getAvgBifurcationRatio
public double getAvgBifurcationRatio()- Returns:
- the average
bifurcation ratioof the parsed tree. In a complete binary tree, the bifurcation ratio is 2.
-
getNodes
- Returns:
- the map containing the nodes associated with each order (Horton-Strahler numbers as key and ratios as value).
-
getRelativeExtensionAngle
Computes the relative extension angle for a StrahlerAnalyzer branch by finding the parent direction from the graph structure.- Parameters:
branch- the branch path to analyze- Returns:
- the relative extension angle in degrees (0-180°), or Double.NaN if computation fails
-
getExtensionAngles
Gets a map of relative extension angles for all branches in each Strahler order.- Returns:
- map with Strahler order as key and list of relative extension angles as values
-
getAvgExtensionAngle
Gets the average relative extension angle for branches of a specific Strahler order.- Parameters:
order- the Strahler order- Returns:
- the average relative extension angle in degrees, or Double.NaN if no valid angles
- Throws:
IllegalArgumentException- if order is invalid
-
getAvgExtensionAngles
Gets a map of average relative extension angles for all Strahler orders.- Returns:
- map with Strahler order as key and average relative extension angle as value
-
main
-
classify
-
dispose
public void dispose()Clears internal caches and mappings to free memory.
-