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);
}
Aggregations