Class StrahlerAnalyzer

java.lang.Object
sc.fiji.snt.analysis.StrahlerAnalyzer

public class StrahlerAnalyzer extends Object
Class to perform Horton-Strahler analysis on a Tree.
Author:
Tiago Ferreira
  • Constructor Details

    • StrahlerAnalyzer

      public StrahlerAnalyzer(Tree tree)
  • Method Details

    • getGraph

      public DirectedWeightedGraph 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() or getRootNumber()-1.
    • getLengths

      public Map<Integer,Double> getLengths()
      Returns:
      the map containing the cable lengh associated to each order ( Horton-Strahler numbers as key and cable length as value).
    • getAvgFragmentations

      public Map<Integer,Double> getAvgFragmentations()
    • getAvgContractions

      public Map<Integer,Double> getAvgContractions()
    • getBranchCounts

      public Map<Integer,Double> getBranchCounts()
      Returns:
      the map containing the number of branches on each order (Horton-Strahler numbers as key and branch count as value).
    • getBranchPointCounts

      public Map<Integer,Double> 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

      public Map<Integer,List<Path>> getBranches()
      Returns:
      the map containing the list of branches on each order (Horton-Strahler numbers as key and branch points count as value).
    • getBranches

      public List<Path> getBranches(int order) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • getRootAssociatedBranches

      public List<Path> getRootAssociatedBranches()
    • getBifurcationRatios

      public Map<Integer,Double> 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 ratio of the parsed tree. In a complete binary tree, the bifurcation ratio is 2.
    • getNodes

      protected Map<Integer,List<SWCPoint>> getNodes()
      Returns:
      the map containing the nodes associated with each order (Horton-Strahler numbers as key and ratios as value).
    • getRelativeExtensionAngle

      public double getRelativeExtensionAngle(Path branch)
      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

      public Map<Integer,List<Double>> getExtensionAngles(boolean relative)
      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

      public double getAvgExtensionAngle(boolean relative, int order) throws IllegalArgumentException
      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

      public Map<Integer,Double> getAvgExtensionAngles(boolean relative)
      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

      public static void main(String[] args)
    • classify

      public static void classify(DirectedWeightedGraph graph, boolean reverseOrder)
    • dispose

      public void dispose()
      Clears internal caches and mappings to free memory.