Search in sources :

Example 1 with PCPALMMolecules

use of gdsc.smlm.ij.plugins.pcpalm.PCPALMMolecules in project GDSC-SMLM by aherbert.

the class BlinkEstimator method calculateAveragePrecision.

private double calculateAveragePrecision(MemoryPeakResults results, boolean verbose) {
    PCPALMMolecules fitter = new PCPALMMolecules();
    ArrayList<Molecule> molecules = fitter.extractLocalisations(results);
    String title = (verbose) ? TITLE + " Localisation Precision" : null;
    double fittedAverage = fitter.calculateAveragePrecision(molecules, title, histogramBins, true, true);
    // Sense check the precision
    if (fittedAverage < 5 || fittedAverage > 60) {
        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;
}
Also used : Molecule(gdsc.smlm.ij.plugins.pcpalm.Molecule) ExtendedGenericDialog(ij.gui.ExtendedGenericDialog) GenericDialog(ij.gui.GenericDialog) PCPALMMolecules(gdsc.smlm.ij.plugins.pcpalm.PCPALMMolecules)

Aggregations

Molecule (gdsc.smlm.ij.plugins.pcpalm.Molecule)1 PCPALMMolecules (gdsc.smlm.ij.plugins.pcpalm.PCPALMMolecules)1 ExtendedGenericDialog (ij.gui.ExtendedGenericDialog)1 GenericDialog (ij.gui.GenericDialog)1