Package sc.fiji.snt.util
Class PointDeduplicator
java.lang.Object
sc.fiji.snt.util.PointDeduplicator
Greedy non-maximum suppression (NMS) for scored 3D points. Given a set of
points with associated scores and a merging distance, returns the subset of
points that survive suppression: starting from the highest-scoring point,
each point is accepted only if no already-accepted point lies within the
merging distance.
This is useful for deduplicating detections that appear in overlapping neighborhoods (e.g., the same varicosity detected in adjacent cross-sections).
- Author:
- Tiago Ferreira
-
Constructor Summary
ConstructorsConstructorDescriptionPointDeduplicator(List<? extends SNTPoint> points, double[] scores, double mergingDistance) Creates a new deduplicator. -
Method Summary
-
Constructor Details
-
PointDeduplicator
Creates a new deduplicator.- Parameters:
points- the points to deduplicatescores- score for each point (same length aspoints); higher scores are preferred during suppressionmergingDistance- points closer than this (in the same units as the point coordinates) are considered duplicates- Throws:
IllegalArgumentException- if array lengths differ or distance is negative
-
-
Method Details
-
run
Runs the greedy NMS.- Returns:
- the surviving points, ordered by descending score
-
runIndices
Runs the greedy NMS and returns the original indices of surviving points.- Returns:
- indices into the original input list, ordered by descending score
-