Search in sources :

Example 1 with RankedScoreCalculator

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

the class MultiPathFilter method score.

/**
	 * Score the assignments (TP/FP) and then clear the list.
	 *
	 * @param assignments
	 *            The assignments
	 * @param score
	 *            Scores array to accumulate TP/FP scores
	 * @param nPredicted
	 *            The number of predictions
	 * @param save
	 *            Set to true to save the scored assignments
	 * @param nActual
	 *            The number of actual results in the frame
	 * @return the fractional assignments
	 */
private FractionalAssignment[] score(final ArrayList<FractionalAssignment> assignments, final double[] score, final int nPredicted, boolean save, int nActual) {
    if (assignments.isEmpty())
        return null;
    final FractionalAssignment[] tmp = assignments.toArray(new FractionalAssignment[assignments.size()]);
    final RankedScoreCalculator calc = new RankedScoreCalculator(tmp, nActual, nPredicted);
    final double[] result = calc.score(nPredicted, false, save);
    score[0] += result[0];
    score[1] += result[1];
    score[2] += result[2];
    score[3] += result[3];
    assignments.clear();
    return calc.getScoredAssignments();
}
Also used : FractionalAssignment(gdsc.core.match.FractionalAssignment) RankedScoreCalculator(gdsc.core.match.RankedScoreCalculator)

Aggregations

FractionalAssignment (gdsc.core.match.FractionalAssignment)1 RankedScoreCalculator (gdsc.core.match.RankedScoreCalculator)1