Package sc.fiji.snt.analysis
Class NodeStatistics<T extends PointInImage>
java.lang.Object
sc.fiji.snt.analysis.NodeStatistics<T>
- Type Parameters:
T- Pixel type
Computes summary and descriptive statistics from a Collection of nodes, including convenience methods to plot
distributions of such data.
- Author:
- Tiago Ferreira
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFlag for "Branch length" analysis.static final StringFlag for "Branch order" statistics.static final StringFlag for "Nearest neighbor distance" statistics.static final StringFlag for "Node radius" statistics.static final StringFlag for statistics on "Node intensity values"static final StringFlag for "X coordinates" statistics.static final StringFlag for "Y coordinates" statistics.static final StringFlag for "Z coordinates" statistics. -
Constructor Summary
ConstructorsConstructorDescriptionNodeStatistics(Collection<T> points) Performs statistics on a collection of nodes.NodeStatistics(Collection<T> points, Tree tree) Performs statistics on a collection of nodes. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidassignBranches(Tree tree) Associates the nodes being analyzed to the branches of the specified treestatic <T extends PointInImage>
voidcomputeNearestNeighborDistances(List<T> points) Computes nearest neighbor distances.Filters the current pool of nodes matching a measurement-based criterion.get(BrainAnnotation compartment) Gets the list of nodes associated with the specified compartment (neuropil label).get(BrainAnnotation compartment, boolean includeChildren) Gets the list of nodes associated with the specified compartment (neuropil label).Retrieves the count frequencies across brain compartment.getAnnotatedFrequencies(int level) Retrieves the count frequencies across brain compartment.getAnnotatedFrequencies(int level, String hemisphere) Retrieves the count frequencies across brain compartment.Map<BrainAnnotation, int[]> getAnnotatedFrequenciesByHemisphere(int level, Tree tree) getAnnotatedFrequencyHistogram(int depth, String hemisphere, Tree tree) Retrieves the histogram of count frequencies across brain areas of the specified ontology level across the specified hemisphere.Retrieves the histogram of count frequencies across brain areas.getAnnotatedHistogram(int depth) Retrieves the histogram of count frequencies across brain areas of the specified ontology level.Splits the nodes being analyzed into groups sharing the same brain annotation.getAnnotatedNodes(int level) Splits the nodes being analyzed into groups sharing the same brain annotation.org.apache.commons.math3.stat.descriptive.DescriptiveStatisticsgetDescriptiveStatistics(String metric) Computes theDescriptiveStatisticsfor the specified measurement.getHistogram(String metric) Gets the relative frequencies histogram for a univariate measurement.Gets the list of supported metrics.protected static StringgetNormalizedMeasurement(String measurement) protected static StringgetStandardizedMetric(String guess) protected booleanstatic voidvoidSets a descriptive label to this statistic analysis to be used in histograms, etc.
-
Field Details
-
BRANCH_LENGTH
Flag for "Branch length" analysis.- See Also:
-
BRANCH_ORDER
Flag for "Branch order" statistics.- See Also:
-
NEAREST_NEIGHBOR_DISTANCE
Flag for "Nearest neighbor distance" statistics.- See Also:
-
RADIUS
Flag for "Node radius" statistics.- See Also:
-
X_COORDINATES
Flag for "X coordinates" statistics.- See Also:
-
Y_COORDINATES
Flag for "Y coordinates" statistics.- See Also:
-
Z_COORDINATES
Flag for "Z coordinates" statistics.- See Also:
-
VALUES
Flag for statistics on "Node intensity values"- See Also:
-
-
Constructor Details
-
NodeStatistics
Performs statistics on a collection of nodes.- Parameters:
points- the points to be analyzed
-
NodeStatistics
Performs statistics on a collection of nodes.- Parameters:
points- the points to be analyzedtree- the Tree associated withpoints
-
-
Method Details
-
getMetrics
Gets the list of supported metrics.- Returns:
- the list of supported metrics
-
setLabel
Sets a descriptive label to this statistic analysis to be used in histograms, etc.- Parameters:
label- the descriptive label
-
getDescriptiveStatistics
public org.apache.commons.math3.stat.descriptive.DescriptiveStatistics getDescriptiveStatistics(String metric) throws UnknownMetricException Computes theDescriptiveStatisticsfor the specified measurement.- Parameters:
metric- the measurement (X_COORDINATES,Y_COORDINATES, etc.)- Returns:
- the DescriptiveStatistics object.
- Throws:
UnknownMetricException
-
filter
public List<T> filter(String metric, double lowerBound, double upperBound) throws UnknownMetricException Filters the current pool of nodes matching a measurement-based criterion.- Parameters:
metric- the measurement (X_COORDINATES,Y_COORDINATES,BRANCH_ORDER, etc.)lowerBound- the lower metric value (inclusive)upperBound- the upper metric value (inclusive)- Returns:
- the filtered list.
- Throws:
UnknownMetricException
-
getHistogram
Gets the relative frequencies histogram for a univariate measurement. The number of bins is determined using the Freedman-Diaconis rule.- Parameters:
metric- the measurement (X_COORDINATES,RADIUS, etc.)- Returns:
- the frame holding the histogram
-
get
Gets the list of nodes associated with the specified compartment (neuropil label).- Parameters:
compartment- the query compartment (null not allowed). All of its children will be considered- Returns:
- the list of filtered nodes
-
get
Gets the list of nodes associated with the specified compartment (neuropil label).- Parameters:
compartment- the query compartment (null not allowed)includeChildren- whether children ofcompartmentshould be included- Returns:
- the list of filtered nodes
-
getAnnotatedNodes
Splits the nodes being analyzed into groups sharing the same brain annotation.- Returns:
- the map containing the brain annotations as keys, and list of nodes as values.
-
getAnnotatedNodes
Splits the nodes being analyzed into groups sharing the same brain annotation.- Parameters:
level- the ontological depth of the compartments to be considered- Returns:
- the map containing the brain annotations as keys, and list of nodes as values.
-
getAnnotatedFrequencies
Retrieves the count frequencies across brain compartment.- Returns:
- the map containing the brain compartments as keys, and count frequencies as values.
-
getAnnotatedFrequencies
Retrieves the count frequencies across brain compartment.- Parameters:
level- the ontological depth of the compartments to be considered- Returns:
- the map containing the brain compartments as keys, and count frequencies as values.
- See Also:
-
getAnnotatedFrequencies
Retrieves the count frequencies across brain compartment.- Parameters:
level- the ontological depth of the compartments to be consideredhemisphere- typically 'left' or 'right'. The hemisphere flag (BrainAnnotation.LEFT_HEMISPHEREorBrainAnnotation.RIGHT_HEMISPHERE) is extracted from the first character of the string (case-insensitive). Ignored if not a recognized option- Returns:
- the map containing the brain compartments as keys, and frequencies as values.
- See Also:
-
getAnnotatedFrequenciesByHemisphere
-
getAnnotatedHistogram
Retrieves the histogram of count frequencies across brain areas.- Returns:
- the annotated frequencies histogram
-
getAnnotatedHistogram
Retrieves the histogram of count frequencies across brain areas of the specified ontology level.- Parameters:
depth- the ontological depth of the compartments to be considered- Returns:
- the annotated frequencies histogram
- See Also:
-
getAnnotatedFrequencyHistogram
Retrieves the histogram of count frequencies across brain areas of the specified ontology level across the specified hemisphere.- Parameters:
depth- the ontological depth of the compartments to be consideredhemisphere- 'left', 'right' or 'ratio' (case-insensitive). Ignored if not a recognized optiontree- the Tree associated with the nodes being analyzed. Only used if hemisphere is 'ratio'.- Returns:
- the annotated frequencies histogram
- See Also:
-
getStandardizedMetric
-
assignBranches
Associates the nodes being analyzed to the branches of the specified tree- Parameters:
tree- the association tree
-
isBranchesAssigned
protected boolean isBranchesAssigned() -
getNormalizedMeasurement
-
assessIfBranchesHaveBeenAssigned
protected void assessIfBranchesHaveBeenAssigned() -
computeNearestNeighborDistances
Computes nearest neighbor distances. Assigns the computed value to thevvalue of each point- Type Parameters:
T- the type of PointImage- Parameters:
points- the list of points
-
main
-