Class StrahlerCmd

java.lang.Object
org.scijava.AbstractContextual
org.scijava.command.ContextCommand
sc.fiji.snt.plugin.StrahlerCmd
All Implemented Interfaces:
Runnable, org.scijava.Cancelable, org.scijava.command.Command, org.scijava.Contextual, org.scijava.plugin.SciJavaPlugin

public class StrahlerCmd extends org.scijava.command.ContextCommand
Command to perform Horton-Strahler analysis on a collection of Trees
Author:
Tiago Ferreira
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new StrahlerCmd.
    Instantiates a new StrahlerCmd.
    Instantiates a new StrahlerCmd for a single Tree
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a boxplot for the specified metric, in which data is grouped by order.
    Returns the 'complete Strahler plot' (e.g., all metrics in a single plot).
    getChart(String metric)
    Returns a 'Strahler plot' for the specified metric.
    Gets the detailed table listing individual branch properties aggregated by Strahler order.
    Returns a histogram for the specified metric, in which data is grouped by order.
    Returns the Tree(s) that could not be parsed (i.e., topologically invalid)
    Gets the summary table containing the tabular results of the analysis.
    Deprecated.
    Use getSummaryTable() instead
    Returns the Tree(s) successfully parsed (i.e., topologically valid)
    static void
    main(String[] args)
     
    void
    run()
     
    void
    setDetailedAnalysis(boolean detailedAnalysis)
    Whether run calls should output detailed tables and plots
    boolean
    Assesses if all trees being analyzed can be parsed (A tree won't be parsed, if topologically invalid, e.g., by containing a loop, or disconnected Paths).

    Methods inherited from class org.scijava.command.ContextCommand

    cancel, getCancelReason, isCanceled

    Methods inherited from class org.scijava.AbstractContextual

    context, getContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.scijava.Contextual

    setContext
  • Constructor Details

    • StrahlerCmd

      public StrahlerCmd()
      Instantiates a new StrahlerCmd. Trees to be analyzed expected as input @parameter
    • StrahlerCmd

      public StrahlerCmd(Collection<Tree> trees)
      Instantiates a new StrahlerCmd.
      Parameters:
      trees - the collection of Trees to be analyzed
    • StrahlerCmd

      public StrahlerCmd(Tree tree)
      Instantiates a new StrahlerCmd for a single Tree
      Parameters:
      tree - the single Tree to be analyzed
  • Method Details

    • run

      public void run()
    • getChart

      public SNTChart getChart()
      Returns the 'complete Strahler plot' (e.g., all metrics in a single plot). If multiple trees are being analyzed, returns a multi-panel montage, in which each panel corresponding to each individual plot.
      Returns:
      the Strahler plot
    • getChart

      public SNTChart getChart(String metric)
      Returns a 'Strahler plot' for the specified metric.
      Parameters:
      metric - either "avg contraction", "avg fragmentation", "bifurcation ratio", "branch count", "extension angle", or "length" (default)
      Returns:
      the Strahler plot
    • getHistogram

      public SNTChart getHistogram(String metric)
      Returns a histogram for the specified metric, in which data is grouped by order.
      Parameters:
      metric - either "branch contraction", "branch fragmentation", "branch relative extension angle", or "branch length" (default)
      Returns:
      the Strahler histogram if only a single Tree is being analyzed, or a montage of histograms if multiple trees are being parsed.
    • getBoxPlot

      public SNTChart getBoxPlot(String metric)
      Returns a boxplot for the specified metric, in which data is grouped by order.
      Parameters:
      metric - either "branch contraction", "branch fragmentation", "branch relative extension angle", or "branch length" (default)
      Returns:
      the Strahler boxplot if only a single Tree is being analyzed, or a montage of plots if multiple trees are being parses.
    • getDetailedTable

      public SNTTable getDetailedTable()
      Gets the detailed table listing individual branch properties aggregated by Strahler order.
      Returns:
      the detailed table
    • getSummaryTable

      public SNTTable getSummaryTable()
      Gets the summary table containing the tabular results of the analysis.
      Returns:
      the summary table
    • getTable

      @Deprecated public SNTTable getTable()
      Deprecated.
      Use getSummaryTable() instead
    • validInput

      public boolean validInput()
      Assesses if all trees being analyzed can be parsed (A tree won't be parsed, if topologically invalid, e.g., by containing a loop, or disconnected Paths).
      Returns:
      true, if successful
    • getValidTrees

      public List<Tree> getValidTrees()
      Returns the Tree(s) successfully parsed (i.e., topologically valid)
      Returns:
      the list of parsed trees
    • getInvalidTrees

      public List<Tree> getInvalidTrees()
      Returns the Tree(s) that could not be parsed (i.e., topologically invalid)
      Returns:
      the list of non-parsable trees
    • setDetailedAnalysis

      public void setDetailedAnalysis(boolean detailedAnalysis)
      Whether run calls should output detailed tables and plots
      Parameters:
      detailedAnalysis - if true, subsequent run() calls will include extra outputs
    • main

      public static void main(String[] args)