Package sc.fiji.snt.analysis.detection
Class AlongPathDetector
java.lang.Object
sc.fiji.snt.analysis.detection.AlongPathDetector
Detects features (boutons, varicosities) along traced paths by
analyzing longitudinal radius and intensity profiles. This complements
PeripathDetector, which detects features in perpendicular
cross-sections around paths.
The detection algorithm is inspired by the bouton detection in the CAR platform (Zhang et al., Nature Methods, 2024). At each node, the radius is compared to the average radius of its neighbors within a sliding window. A node is flagged as a candidate if its radius exceeds the neighbor average by a configurable factor (default 1.5×). Optionally, an intensity threshold can be applied using on-skeleton intensity sampled from the image. Adjacent candidates are merged via greedy non-maximum suppression.
Usage:
AlongPathDetector.Config cfg = new AlongPathDetector.Config()
.swellingFactor(1.5) // flag nodes ≥ 1.5× neighbor average
.windowSize(5) // compare against 5 neighbors each side
.minIntensity(120) // minimum on-skeleton intensity (8-bit)
.mergingDistance(3.0); // NMS radius in calibrated units
List<Detection> boutons = AlongPathDetector.detect(paths, image, cfg);
- Author:
- Tiago Ferreira
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConfiguration for along-path detection with builder-like setters. -
Method Summary
Modifier and TypeMethodDescriptiondetect(Collection<Path> paths, net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> img, AlongPathDetector.Config cfg) Detects swellings (boutons/varicosities) along the given paths by analyzing the longitudinal radius profile and, optionally, on-skeleton image intensity.detect(Collection<Path> paths, AlongPathDetector.Config cfg) Convenience overload that performs radius-only detection (no image).
-
Method Details
-
detect
public static <T extends net.imglib2.type.numeric.RealType<T>> List<Detection> detect(Collection<Path> paths, net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> img, AlongPathDetector.Config cfg) Detects swellings (boutons/varicosities) along the given paths by analyzing the longitudinal radius profile and, optionally, on-skeleton image intensity.- Parameters:
paths- the paths to analyze (must have radii for radius-based detection)img- the image for intensity filtering; may benullif intensity filtering is not needed (minIntensity ≤ 0)cfg- detection parameters- Returns:
- list of detections, deduplicated and optionally assigned to nearest path
- Throws:
IllegalArgumentException- if paths is null/empty, or if intensity filtering is requested but no image is provided
-
detect
Convenience overload that performs radius-only detection (no image).- Parameters:
paths- the paths to analyzecfg- detection parameters (minIntensity should be ≤ 0)- Returns:
- list of detections
-