Class PointDeduplicator

java.lang.Object
sc.fiji.snt.util.PointDeduplicator

public class PointDeduplicator extends Object
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 Details

    • PointDeduplicator

      public PointDeduplicator(List<? extends SNTPoint> points, double[] scores, double mergingDistance)
      Creates a new deduplicator.
      Parameters:
      points - the points to deduplicate
      scores - score for each point (same length as points); higher scores are preferred during suppression
      mergingDistance - 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

      public List<SNTPoint> run()
      Runs the greedy NMS.
      Returns:
      the surviving points, ordered by descending score
    • runIndices

      public List<Integer> runIndices()
      Runs the greedy NMS and returns the original indices of surviving points.
      Returns:
      indices into the original input list, ordered by descending score