Class TuftDetector

java.lang.Object
sc.fiji.snt.tracing.auto.TuftDetector

public class TuftDetector extends Object
Detects tufts (clusters of nearby terminal structure) in a Tree and reports them as ranked SeedPoints.

Four node populations can be scanned, selected via TuftDetector.Type:

A node's score is the (weighted) number of other nodes found within radius of it, optionally further weighted by thickness and/or intensity. Nodes belonging to the same tuft mutually reinforce each other's score, while isolated nodes score low. Candidates are then greedily suppressed by distance (highest score first) so that each tuft is reported once, at the location of its highest-scoring node.

Author:
Tiago Ferreira
See Also:
  • Constructor Details

    • TuftDetector

      public TuftDetector(double radius)
      Creates a detector with the given tuft radius.
      Parameters:
      radius - neighborhood radius (physical units) defining a tuft. Nodes within this distance of each other are treated as candidates for the same tuft
  • Method Details

    • setRadius

      public void setRadius(double radius)
      Sets the tuft radius (physical units)
    • setWeightByThickness

      public void setWeightByThickness(boolean weightByThickness)
      Sets whether each node's thickness (PointInImage.radius, or its per-branch average for TuftDetector.Type.TERMINAL_BRANCHES) is added to its neighbor count when scoring. Default: true
    • setWeightByIntensity

      public void setWeightByIntensity(boolean weightByIntensity)
      Sets whether each node's sampled intensity (PointInImage.v, min-max normalized across the scanned population) is added to its neighbor count when scoring, in addition to (or instead of) thickness. Nodes with unassigned/NaN values contribute 0. Requires the tree to have been profiled beforehand (e.g. via PathProfiler#assignValues()); otherwise every node contributes 0 and this has no effect. Default: false
    • setPenalizeShortBranches

      public void setPenalizeShortBranches(boolean penalizeShortBranches)
      Sets whether short terminal branches have their contribution to the density score down-weighted, for TuftDetector.Type.TERMINAL_BRANCHES only. A discontiguous (e.g. beaded) neurite can fragment into several short, spatially-close but topologically-unrelated terminal branches, which would otherwise look like a genuine dense tuft. Weight is min(1, branchLength / radius), so branches at least as long as radius are unaffected. Default: true
    • setPercentileClip

      public void setPercentileClip(double percentileClip)
      Sets the robustness margin (0-45) for confidence normalization; see SeedConfidence.percentileClipNormalize(double[], double). Default: 10
    • detect

      public List<SeedPoint> detect(Tree tree, TuftDetector.Type type)
      Detects tufts of the given type in tree.
      Parameters:
      tree - the tree to scan
      type - which node population to scan (see TuftDetector.Type)
      Returns:
      one SeedPoint per detected tuft, sorted by descending confidence. Empty if tree has no matching nodes
    • detect

      public List<SeedPoint> detect(Tree tree, List<TuftDetector.Type> types)
      Detects tufts across several node populations in tree in a single pooled pass: candidates from every requested TuftDetector.Type are merged into one KDTree/scoring/suppression run, so a tuft that happens to show up in more than one (e.g. a fork sitting right next to a tip) is still reported once, rather than once per type.
      Parameters:
      tree - the tree to scan
      types - which node population(s) to scan (see TuftDetector.Type)
      Returns:
      one SeedPoint per detected tuft, sorted by descending confidence. Empty if tree has no matching nodes