Search in sources :

Example 6 with Coordinate

use of gdsc.core.match.Coordinate in project GDSC-SMLM by aherbert.

the class ResultsMatchCalculator method compareCoordinates.

/**
	 * Compare the coordinates on a frame-by-frame basis.
	 *
	 * @param actualCoordinates
	 *            the actual coordinates
	 * @param predictedCoordinates
	 *            the predicted coordinates
	 * @param distance
	 *            the distance
	 * @return the match result
	 */
public static MatchResult compareCoordinates(TIntObjectHashMap<ArrayList<Coordinate>> actualCoordinates, TIntObjectHashMap<ArrayList<Coordinate>> predictedCoordinates, double distance) {
    int tp = 0;
    int fp = 0;
    int fn = 0;
    // Process each time point
    for (Integer t : getTimepoints(actualCoordinates, predictedCoordinates)) {
        Coordinate[] actual = getCoordinates(actualCoordinates, t);
        Coordinate[] predicted = getCoordinates(predictedCoordinates, t);
        MatchResult r = MatchCalculator.analyseResults2D(actual, predicted, distance);
        // Aggregate
        tp += r.getTruePositives();
        fp += r.getFalsePositives();
        fn += r.getFalseNegatives();
    }
    return new MatchResult(tp, fp, fn, 0);
}
Also used : Coordinate(gdsc.core.match.Coordinate) MatchResult(gdsc.core.match.MatchResult) Point(java.awt.Point) BasePoint(gdsc.core.match.BasePoint)

Aggregations

Coordinate (gdsc.core.match.Coordinate)6 BasePoint (gdsc.core.match.BasePoint)5 ArrayList (java.util.ArrayList)5 MatchResult (gdsc.core.match.MatchResult)4 Point (java.awt.Point)4 PointPair (gdsc.core.match.PointPair)3 ImageROIPainter (gdsc.smlm.ij.utils.ImageROIPainter)2 PeakResult (gdsc.smlm.results.PeakResult)2 Overlay (ij.gui.Overlay)2 TextWindow (ij.text.TextWindow)2 LinkedList (java.util.LinkedList)2 Pulse (gdsc.core.match.Pulse)1 FitWorker (gdsc.smlm.engine.FitWorker)1 MaximaSpotFilter (gdsc.smlm.filters.MaximaSpotFilter)1 Spot (gdsc.smlm.filters.Spot)1 PeakResultPoint (gdsc.smlm.ij.plugins.ResultsMatchCalculator.PeakResultPoint)1 FilePeakResults (gdsc.smlm.results.FilePeakResults)1 TIntObjectHashMap (gnu.trove.map.hash.TIntObjectHashMap)1 TIntProcedure (gnu.trove.procedure.TIntProcedure)1 TIntHashSet (gnu.trove.set.hash.TIntHashSet)1