use of uk.ac.sussex.gdsc.smlm.ij.plugins.pcpalm.PcPalmMolecules in project GDSC-SMLM by aherbert.
the class BlinkEstimator method calculateAveragePrecision.
private double calculateAveragePrecision(MemoryPeakResults results, boolean verbose) {
double fittedAverage = 0;
try {
final PcPalmMolecules fitter = new PcPalmMolecules();
final List<Molecule> molecules = fitter.extractLocalisations(results);
final String title = (verbose) ? TITLE + " Localisation Precision" : null;
fittedAverage = fitter.calculateAveragePrecision(molecules, title, settings.histogramBins, true, true);
} catch (final DataException ex) {
// This is thrown when the data cannot be converted for precision computation
}
// Sense check the precision
if (fittedAverage < 5 || fittedAverage > 60) {
final GenericDialog gd = new GenericDialog(TITLE);
gd.addMessage("Estimated precision is not within expected bounds.\nPlease enter an estimate:");
gd.addSlider("Precision", 5, 60, fittedAverage);
gd.showDialog();
if (!gd.wasCanceled()) {
fittedAverage = gd.getNextNumber();
}
}
// The fitter does checks for a good fit to the histogram so just return the value
return fittedAverage;
}
Aggregations