public class MultiTreeStatistics extends TreeStatistics
Tree
groups. For analysis of individual Trees use TreeStatistics
.Modifier and Type | Field and Description |
---|---|
protected static String[] |
ALL_FLAGS |
static String |
ASSIGNED_VALUE
Flag specifying
Tree value statistics |
static String |
AVG_BRANCH_LENGTH
Flag for "Average branch length" analysis.
|
static String |
AVG_CONTRACTION
Flag for "Average contraction" statistics
|
static String |
AVG_FRACTAL_DIMENSION
Flag specifying "Average fractal dimension" statistics
|
static String |
AVG_FRAGMENTATION
Flag for "Average fragmentation" statistics
|
static String |
AVG_PARTITION_ASYMMETRY
Flag specifying "Average partition asymmetry" statistics
|
static String |
AVG_REMOTE_ANGLE
Flag specifying "Average remote bif. angle" statistics
|
static String |
AVG_SPINE_DENSITY
Flag for "Average spine/varicosity density" statistics.
|
static String |
DEPTH
Flag for "Depth" statistics
|
static String |
HEIGHT
Flag for "Height" statistics
|
static String |
HIGHEST_PATH_ORDER
Flag specifying "Highest path order" statistics
|
static String |
INNER_LENGTH
Flag for "Length of inner branches (sum)" analysis.
|
static String |
LENGTH
Flag for "Cable length" analysis.
|
static String |
MEAN_RADIUS
Flag for "Mean radius" statistics
|
static String |
N_BRANCH_POINTS
Flag for "No. of branch points" statistics
|
static String |
N_BRANCHES
Flag specifying "No. of branches" statistics
|
static String |
N_FITTED_PATHS
Flag for "No. of fitted paths" statistics
|
static String |
N_INNER_BRANCHES
Flag specifying "No. of inner branches" statistics
|
static String |
N_NODES
Flag for "No. of nodes" statistics
|
static String |
N_PATHS
Flag for "No. of paths" statistics
|
static String |
N_PRIMARY_BRANCHES
Flag specifying "No. of primary branches" statistics
|
static String |
N_SPINES
Flag for "No of spines/varicosities" statistics
|
static String |
N_TERMINAL_BRANCHES
Flag specifying "No. of terminal branches" statistics
|
static String |
N_TIPS
Flag specifying "No. of tips" statistics
|
static String |
PRIMARY_LENGTH
Flag for "Length of primary branches (sum)" analysis.
|
static String |
STRAHLER_NUMBER
Flag specifying
Horton-Strahler number statistics |
static String |
STRAHLER_RATIO
Flag specifying
Horton-Strahler bifurcation ratio statistics |
static String |
TERMINAL_LENGTH
Flag for "Length of terminal branches (sum)" analysis.
|
static String |
WIDTH
Flag for "Width" statistics
|
BRANCH_LENGTH, CONTRACTION, FRACTAL_DIMENSION, INTER_NODE_DISTANCE, INTER_NODE_DISTANCE_SQUARED, lastDstats, NODE_RADIUS, PARTITION_ASYMMETRY, PATH_CHANNEL, PATH_FRAME, PATH_LENGTH, PATH_ORDER, REMOTE_BIF_ANGLES, VALUES, X_COORDINATES, Y_COORDINATES, Z_COORDINATES
displayService, innerBranches, primaryBranches, statusService, table, terminalBranches, tips, tree
Constructor and Description |
---|
MultiTreeStatistics(Collection<Tree> group)
Instantiates a new instance from a collection of Trees.
|
MultiTreeStatistics(Collection<Tree> group,
String... swcTypes)
Instantiates a new instance from a collection of Trees.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assembleStats(sc.fiji.snt.analysis.TreeStatistics.StatisticsInstance stat,
String measurement) |
static List<String> |
getAllMetrics()
Gets the list of all supported metrics.
|
Map<BrainAnnotation,Double> |
getAnnotatedLength(int level)
Retrieves the amount of cable length present on each brain compartment
innervated by the analyzed neuron.
|
Map<BrainAnnotation,Double> |
getAnnotatedLength(int level,
String hemisphere)
Retrieves the amount of cable length present on each brain compartment
innervated by the analyzed neuron.
|
Map<BrainAnnotation,double[]> |
getAnnotatedLengthsByHemisphere(int level) |
Set<BrainAnnotation> |
getAnnotations() |
Set<BrainAnnotation> |
getAnnotations(int level) |
List<Path> |
getBranches()
Gets all the branches in the analyzed tree.
|
Set<PointInImage> |
getBranchPoints()
Gets the position of all the branch points in the analyzed tree.
|
double |
getCableLength(BrainAnnotation compartment)
Gets the cable length associated with the specified compartment (neuropil
label).
|
DescriptiveStatistics |
getDescriptiveStats(String metric)
Computes the
DescriptiveStatistics for the specified measurement. |
Collection<Tree> |
getGroup()
Gets the collection of Trees being analyzed.
|
SNTChart |
getHistogram(String metric)
Retrieves the histogram of relative frequencies histogram for a univariate
measurement.
|
List<Path> |
getInnerBranches()
Retrieves the branches of highest
Strahler order in the Tree. |
static List<String> |
getMetrics()
Gets the list of most commonly used metrics.
|
protected static String |
getNormalizedMeasurement(String measurement,
boolean defaultToTreeStatistics) |
List<Path> |
getPrimaryBranches()
Retrieves the primary branches of the analyzed Tree.
|
ShollAnalyzer |
getShollAnalyzer()
Gets the
ShollAnalyzer instance associated with this analyzer. |
StrahlerAnalyzer |
getStrahlerAnalyzer()
Gets the
StrahlerAnalyzer instance associated with this analyzer |
SummaryStatistics |
getSummaryStats(String metric)
Computes the
SummaryStatistics for the specified measurement. |
List<Path> |
getTerminalBranches()
Retrieves the terminal branches of the analyzed Tree.
|
Set<PointInImage> |
getTips()
Gets the position of all the tips in the analyzed tree.
|
static void |
main(String[] args) |
void |
resetRestrictions()
Removes any filtering restrictions that may have been set.
|
void |
restrictToSWCType(int... types)
Restricts analysis to Paths sharing the specified SWC flag(s).
|
void |
setLabel(String groupLabel)
Sets an identifying label for the group of Trees being analyzed.
|
protected static String |
tryReallyHardToGuessMetric(String guess) |
fromCollection, getAnalyzerMetrics, getAnnotatedLength, getAnnotatedLengthHistogram, getAnnotatedLengthHistogram, getAnnotatedLengthHistogram, getAnnotatedLengthHistogram, getAnnotatedLengthsByHemisphere, getAnnotatedLengthsByHemisphereHistogram, getHistogram, getNodeStatistics, getNodeStatistics, getNormalizedMeasurement, lastDstatsCanBeRecycled
getAvgBranchLength, getAvgContraction, getAvgFractalDimension, getAvgFragmentation, getAvgPartitionAsymmetry, getAvgRemoteBifAngle, getBranchPoints, getCableLength, getCableLength, getCableLengthNorm, getCol, getDepth, getFractalDimension, getHeight, getHighestPathOrder, getInnerLength, getMetric, getMetricInternal, getMetricWithoutChecks, getNBranches, getNbranchPoints, getNbranchPointsNorm, getNextRow, getNFittedPaths, getNoSpinesOrVaricosities, getNPaths, getNtips, getNtipsNorm, getParsedTree, getPartitionAsymmetry, getPrimaryLength, getPrimaryPaths, getRemoteBifAngles, getSinglePointPaths, getSpineOrVaricosityDensity, getStrahlerBifurcationRatio, getStrahlerNumber, getSWCTypesAsString, getTable, getTerminalLength, getTips, getWidth, ignoreSWCType, isSameOrParentAnnotation, isValid, measure, measure, restrictToLength, restrictToNamePattern, restrictToOrder, restrictToSize, run, setTable, setTable, summarize, summarize, updateAndDisplayTable
cancel, getCancelReason, isCanceled
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setContext
public static final String LENGTH
public static final String TERMINAL_LENGTH
public static final String INNER_LENGTH
public static final String PRIMARY_LENGTH
public static final String AVG_BRANCH_LENGTH
public static final String ASSIGNED_VALUE
Tree value
statisticspublic static final String STRAHLER_NUMBER
Horton-Strahler number
statisticspublic static final String STRAHLER_RATIO
Horton-Strahler bifurcation ratio
statisticspublic static final String HIGHEST_PATH_ORDER
public static final String N_BRANCHES
public static final String N_PRIMARY_BRANCHES
public static final String N_INNER_BRANCHES
public static final String N_TERMINAL_BRANCHES
public static final String N_BRANCH_POINTS
public static final String N_SPINES
public static final String AVG_CONTRACTION
public static final String AVG_FRAGMENTATION
public static final String AVG_REMOTE_ANGLE
public static final String AVG_PARTITION_ASYMMETRY
public static final String AVG_FRACTAL_DIMENSION
public static final String AVG_SPINE_DENSITY
public static final String N_PATHS
public static final String MEAN_RADIUS
public static final String N_NODES
public static final String N_TIPS
public static final String WIDTH
public static final String HEIGHT
public static final String DEPTH
public static final String N_FITTED_PATHS
protected static String[] ALL_FLAGS
public MultiTreeStatistics(Collection<Tree> group)
group
- the collection of Trees to be analyzedpublic MultiTreeStatistics(Collection<Tree> group, String... swcTypes) throws NoSuchElementException
group
- the collection of Trees to be analyzedswcTypes
- SWC type(s) a string with at least 2 characters describing
the SWC type allowed in the subtree (e.g., 'axn', or
'dendrite')NoSuchElementException
- swcTypes
are not applicable to group
public static List<String> getAllMetrics()
public static List<String> getMetrics()
public Collection<Tree> getGroup()
public void setLabel(String groupLabel)
groupLabel
- the identifying string for the group.protected static String getNormalizedMeasurement(String measurement, boolean defaultToTreeStatistics) throws sc.fiji.snt.analysis.UnknownMetricException
public SummaryStatistics getSummaryStats(String metric)
TreeStatistics
SummaryStatistics
for the specified measurement.getSummaryStats
in class TreeStatistics
metric
- the measurement (TreeStatistics.N_NODES
, TreeStatistics.NODE_RADIUS
,
etc.)public DescriptiveStatistics getDescriptiveStats(String metric)
TreeStatistics
DescriptiveStatistics
for the specified measurement.getDescriptiveStats
in class TreeStatistics
metric
- the measurement (TreeStatistics.N_NODES
, TreeStatistics.NODE_RADIUS
,
etc.)protected void assembleStats(sc.fiji.snt.analysis.TreeStatistics.StatisticsInstance stat, String measurement) throws sc.fiji.snt.analysis.UnknownMetricException
assembleStats
in class TreeStatistics
sc.fiji.snt.analysis.UnknownMetricException
public void restrictToSWCType(int... types)
TreeAnalyzer
restrictToSWCType
in class TreeAnalyzer
types
- the allowed SWC flags (e.g., Path.SWC_AXON
, etc.)public void resetRestrictions()
TreeAnalyzer
resetRestrictions
in class TreeAnalyzer
public StrahlerAnalyzer getStrahlerAnalyzer() throws IllegalArgumentException
TreeAnalyzer
StrahlerAnalyzer
instance associated with this analyzergetStrahlerAnalyzer
in class TreeAnalyzer
IllegalArgumentException
- if tree contains multiple roots or loopspublic ShollAnalyzer getShollAnalyzer()
TreeAnalyzer
ShollAnalyzer
instance associated with this analyzer. Note
that changes to ShollAnalyzer
must be performed before calling
TreeAnalyzer.getMetric(String)
, TreeAnalyzer.measure(Collection, boolean)
, etc.getShollAnalyzer
in class TreeAnalyzer
public Set<BrainAnnotation> getAnnotations()
getAnnotations
in class TreeAnalyzer
public Set<BrainAnnotation> getAnnotations(int level)
getAnnotations
in class TreeAnalyzer
public double getCableLength(BrainAnnotation compartment)
TreeAnalyzer
getCableLength
in class TreeAnalyzer
compartment
- the query compartment (null not allowed). All of its
children will be consideredpublic Map<BrainAnnotation,Double> getAnnotatedLength(int level, String hemisphere)
TreeStatistics
getAnnotatedLength
in class TreeStatistics
level
- the ontological depth of the compartments to be consideredhemisphere
- typically 'left' or 'right'. The hemisphere flag (
BrainAnnotation.LEFT_HEMISPHERE
or
BrainAnnotation.RIGHT_HEMISPHERE
) is extracted from
the first character of the string (case insensitive).
Ignored if not a recognized optionAllenCompartment.getOntologyDepth()
public Map<BrainAnnotation,Double> getAnnotatedLength(int level)
TreeStatistics
getAnnotatedLength
in class TreeStatistics
level
- the ontological depth of the compartments to be consideredAllenCompartment.getOntologyDepth()
public Map<BrainAnnotation,double[]> getAnnotatedLengthsByHemisphere(int level)
getAnnotatedLengthsByHemisphere
in class TreeStatistics
public SNTChart getHistogram(String metric)
TreeStatistics
getHistogram
in class TreeStatistics
metric
- the measurement (TreeStatistics.N_NODES
, TreeStatistics.NODE_RADIUS
, etc.)public Set<PointInImage> getTips()
TreeAnalyzer
getTips
in class TreeAnalyzer
public Set<PointInImage> getBranchPoints()
TreeAnalyzer
getBranchPoints
in class TreeAnalyzer
public List<Path> getBranches() throws IllegalArgumentException
TreeAnalyzer
getBranches
in class TreeAnalyzer
IllegalArgumentException
- if tree contains multiple roots or loopsStrahlerAnalyzer.getBranches()
public List<Path> getPrimaryBranches()
TreeAnalyzer
getPrimaryBranches
in class TreeAnalyzer
TreeAnalyzer.getPrimaryPaths()
,
StrahlerAnalyzer.getRootAssociatedBranches()
public List<Path> getInnerBranches()
TreeAnalyzer
Strahler order
in the Tree.
This typically correspond to the most 'internal' branches of the Tree in
direct sequence from the root.getInnerBranches
in class TreeAnalyzer
TreeAnalyzer.getPrimaryPaths()
,
StrahlerAnalyzer.getBranches()
,
StrahlerAnalyzer.getHighestBranchOrder()
public List<Path> getTerminalBranches()
TreeAnalyzer
getTerminalBranches
in class TreeAnalyzer
Path.getSection(int, int)
, these branches will not carry any
connectivity information.TreeAnalyzer.getPrimaryBranches()
,
TreeAnalyzer.restrictToOrder(int...)
public static void main(String[] args)
Copyright © 2018–2021 Morphonets. All rights reserved.