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