Search in sources :

Example 21 with FitEngineConfiguration

use of gdsc.smlm.engine.FitEngineConfiguration in project GDSC-SMLM by aherbert.

the class SettingsManager method unsafeLoadFitEngineConfiguration.

/**
	 * Load the configuration within the specified file
	 * 
	 * @param filename
	 * @return The configuration (or null)
	 */
public static FitEngineConfiguration unsafeLoadFitEngineConfiguration(String filename) {
    XStream xs = createXStream();
    FitEngineConfiguration config = null;
    FileInputStream fs = null;
    try {
        fs = new FileInputStream(filename);
        config = (FitEngineConfiguration) xs.fromXML(fs);
    } catch (ClassCastException ex) {
    //ex.printStackTrace();
    } catch (FileNotFoundException ex) {
    //ex.printStackTrace();
    } catch (XStreamException ex) {
        ex.printStackTrace();
    } finally {
        if (fs != null) {
            try {
                fs.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    return config;
}
Also used : XStreamException(com.thoughtworks.xstream.XStreamException) XStream(com.thoughtworks.xstream.XStream) FitEngineConfiguration(gdsc.smlm.engine.FitEngineConfiguration) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream)

Example 22 with FitEngineConfiguration

use of gdsc.smlm.engine.FitEngineConfiguration in project GDSC-SMLM by aherbert.

the class SpotInspector method getStandardDeviation.

private float getStandardDeviation(MemoryPeakResults results2) {
    // Standard deviation is only needed for the width filtering
    if (sortOrderIndex != 8)
        return 0;
    FitEngineConfiguration config = (FitEngineConfiguration) XmlUtils.fromXML(results.getConfiguration());
    if (config == null || config.getFitConfiguration() == null) {
        return -1;
    }
    FitConfiguration fitConfig = config.getFitConfiguration();
    float stdDevMax = (float) ((fitConfig.getInitialPeakStdDev0() > 0) ? fitConfig.getInitialPeakStdDev0() : 1);
    if (fitConfig.getInitialPeakStdDev1() > 0)
        stdDevMax = (float) FastMath.max(fitConfig.getInitialPeakStdDev1(), stdDevMax);
    return stdDevMax;
}
Also used : FitEngineConfiguration(gdsc.smlm.engine.FitEngineConfiguration) FitConfiguration(gdsc.smlm.fitting.FitConfiguration)

Aggregations

FitEngineConfiguration (gdsc.smlm.engine.FitEngineConfiguration)22 FitConfiguration (gdsc.smlm.fitting.FitConfiguration)16 GlobalSettings (gdsc.smlm.ij.settings.GlobalSettings)9 ExtendedGenericDialog (ij.gui.ExtendedGenericDialog)6 Calibration (gdsc.smlm.results.Calibration)5 GenericDialog (ij.gui.GenericDialog)4 Checkbox (java.awt.Checkbox)4 XStreamException (com.thoughtworks.xstream.XStreamException)3 BasePoint (gdsc.core.match.BasePoint)3 PeakResultPoint (gdsc.smlm.ij.plugins.ResultsMatchCalculator.PeakResultPoint)3 ResultsSettings (gdsc.smlm.ij.settings.ResultsSettings)3 DirectFilter (gdsc.smlm.results.filter.DirectFilter)3 MultiPathFilter (gdsc.smlm.results.filter.MultiPathFilter)3 MemoryPeakResults (gdsc.smlm.results.MemoryPeakResults)2 Choice (java.awt.Choice)2 TextField (java.awt.TextField)2 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 Vector (java.util.Vector)2