public class TreeAnalyzer
extends org.scijava.command.ContextCommand
Tree
sModifier and Type | Field and Description |
---|---|
static java.lang.String |
BRANCH_ORDER
Flag for "Branch order" analysis.
|
static java.lang.String[] |
COMMON_MEASUREMENTS |
static java.lang.String |
INTER_NODE_DISTANCE
Flag for "Inter-node distance" analysis.
|
static java.lang.String |
INTER_NODE_DISTANCE_SQUARED
Flag for "Inter-node distance (squared)" analysis.
|
static java.lang.String |
LENGTH
Flag for "Length" analysis.
|
static java.lang.String |
MEAN_RADIUS
Flag for "Path mean radius" analysis.
|
static java.lang.String |
N_BRANCH_POINTS
Flag for "No. of branch points" analysis.
|
static java.lang.String |
N_NODES
Flag for "No. of nodes" analysis.
|
static java.lang.String |
NODE_RADIUS
Flag for "Node radius" analysis.
|
static java.lang.String |
VALUES
Flag for analysis of "Node intensity values", an optional numeric property that
can be assigned to Path nodes (typically voxel intensities, assigned via
PathProfiler . |
static java.lang.String |
X_COORDINATES
Flag for "X coordinates" analysis.
|
static java.lang.String |
Y_COORDINATES
Flag for "Y coordinates" analysis.
|
static java.lang.String |
Z_COORDINATES
Flag for "Z coordinates" analysis.
|
Constructor and Description |
---|
TreeAnalyzer(Tree tree)
Instantiates a new Tree analyzer.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<PointInImage> |
getBranchPoints()
Gets the position of all the branch points in the analyzed tree.
|
double |
getCableLength()
Gets the cable length.
|
int |
getNPaths()
Gets the no.
|
Tree |
getParsedTree()
Returns the set of parsed Paths.
|
java.util.Set<Path> |
getPrimaryBranches()
Retrieves the primary branches of the analyzed Tree.
|
double |
getPrimaryLength()
Gets the cable length of primary branches.
|
java.util.Set<Path> |
getPrimaryPaths()
Retrieves all the Paths in the analyzed Tree tagged as primary.
|
int |
getStrahlerRootNumber()
Gets the Strahler-Horton root number of the analyzed tree
|
org.scijava.table.DefaultGenericTable |
getTable()
Gets the table currently being used by the Analyzer
|
java.util.Set<Path> |
getTerminalBranches()
Retrieves the terminal branches of the analyzed Tree.
|
double |
getTerminalLength()
Gets the cable length of terminal branches
|
java.util.Set<PointInImage> |
getTips()
Gets the position of all the tips in the analyzed tree.
|
void |
ignoreSWCType(int... types)
Ignores Paths sharing the specified SWC flag(s).
|
static void |
main(java.lang.String[] args) |
void |
resetRestrictions()
Removes any filtering restrictions that may have been set.
|
void |
restrictToLength(double lowerBound,
double upperBound)
Restricts analysis to paths sharing the specified length range.
|
void |
restrictToNamePattern(java.lang.String pattern)
Restricts analysis to Paths containing the specified string in their name.
|
void |
restrictToOrder(int... orders)
Restricts analysis to Paths sharing the specified branching order(s).
|
void |
restrictToSize(int minSize,
int maxSize)
Restricts analysis to paths having the specified number of nodes.
|
void |
restrictToSWCType(int... types)
Restricts analysis to Paths sharing the specified SWC flag(s).
|
void |
run()
Generates detailed summaries in which measurements are grouped by SWC-type
flags
|
void |
setTable(org.scijava.table.DefaultGenericTable table)
Sets the Analyzer table.
|
void |
setTable(org.scijava.table.DefaultGenericTable table,
java.lang.String title)
Sets the table.
|
void |
summarize(boolean groupByType)
Outputs a summary of the current analysis to the Analyzer table using the
default Tree label.
|
void |
summarize(java.lang.String rowHeader,
boolean groupByType)
Outputs a summary of the current analysis to the Analyzer table.
|
void |
updateAndDisplayTable()
Updates and displays the Analyzer table.
|
public static final java.lang.String BRANCH_ORDER
public static final java.lang.String INTER_NODE_DISTANCE
public static final java.lang.String INTER_NODE_DISTANCE_SQUARED
public static final java.lang.String LENGTH
public static final java.lang.String N_BRANCH_POINTS
public static final java.lang.String N_NODES
public static final java.lang.String NODE_RADIUS
public static final java.lang.String MEAN_RADIUS
public static final java.lang.String X_COORDINATES
public static final java.lang.String Y_COORDINATES
public static final java.lang.String Z_COORDINATES
public static final java.lang.String VALUES
PathProfiler
. Note that an IllegalArgumentException
is
triggered if no values have been assigned to the tree being analyzed.public static final java.lang.String[] COMMON_MEASUREMENTS
public TreeAnalyzer(Tree tree)
tree
- Collection of Paths to be analyzed. Note that null Paths are
discarded. Also, when a Path has been fitted and
Path.getUseFitted()
is true, its fitted 'flavor' is used.getParsedTree()
public void restrictToSWCType(int... types)
types
- the allowed SWC flags (e.g., Path.SWC_AXON
, etc.)public void ignoreSWCType(int... types)
types
- the SWC flags to be ignored (e.g., Path.SWC_AXON
,
etc.)public void restrictToOrder(int... orders)
orders
- the allowed branching orderspublic void restrictToSize(int minSize, int maxSize)
minSize
- the smallest number of nodes a path must have in order to be
analyzed. Set it to -1 to disable minSize filteringmaxSize
- the largest number of nodes a path must have in order to be
analyzed. Set it to -1 to disable maxSize filteringpublic void restrictToLength(double lowerBound, double upperBound)
lowerBound
- the smallest length a path must have in order to be
analyzed. Set it to Double.NaN to disable lowerBound filteringupperBound
- the largest length a path must have in order to be
analyzed. Set it to Double.NaN to disable upperBound filteringpublic void restrictToNamePattern(java.lang.String pattern)
pattern
- the string to search forpublic void resetRestrictions()
public Tree getParsedTree()
resetRestrictions()
public void summarize(boolean groupByType)
groupByType
- if true measurements are grouped by SWC-type flagrun()
,
setTable(DefaultGenericTable)
public void summarize(java.lang.String rowHeader, boolean groupByType)
rowHeader
- the String to be used as label for the summarygroupByType
- if true measurements are grouped by SWC-type flagrun()
,
setTable(DefaultGenericTable)
public void setTable(org.scijava.table.DefaultGenericTable table)
table
- the table to be used by the analyzersummarize(boolean)
public void setTable(org.scijava.table.DefaultGenericTable table, java.lang.String title)
table
- the table to be used by the analyzertitle
- the title of the table display windowpublic org.scijava.table.DefaultGenericTable getTable()
public void run()
summarize(String, boolean)
public void updateAndDisplayTable()
public int getNPaths()
public java.util.Set<Path> getPrimaryPaths()
getPrimaryBranches()
public java.util.Set<Path> getPrimaryBranches()
Path.getSection(int, int)
, these branches will not carry any
connectivity information.getPrimaryPaths()
,
restrictToOrder(int...)
public java.util.Set<Path> getTerminalBranches()
Path.getSection(int, int)
, these branches will not carry any
connectivity information.getPrimaryBranches()
,
restrictToOrder(int...)
public java.util.Set<PointInImage> getTips()
public java.util.Set<PointInImage> getBranchPoints()
public double getCableLength()
public double getPrimaryLength()
getPrimaryBranches()
public double getTerminalLength()
getTerminalBranches()
public int getStrahlerRootNumber()
public static void main(java.lang.String[] args) throws java.lang.InterruptedException
java.lang.InterruptedException