Search in sources :

Example 1 with LocalisationList

use of uk.ac.sussex.gdsc.smlm.ij.plugins.LoadLocalisations.LocalisationList in project GDSC-SMLM by aherbert.

the class CreateData method getSimulationResults.

private static MemoryPeakResults getSimulationResults() {
    if (benchmarkAuto) {
        // Load directly from a results file. This is mainly to be used to load simulations
        // saved to memory then saved to file.
        final PeakResultsReader r = new PeakResultsReader(benchmarkFile);
        final MemoryPeakResults results = r.getResults();
        if (results != null) {
            ResultsManager.checkCalibration(results);
            return results;
        }
    }
    // Load using a universal text file
    if (loadSettings == null) {
        loadSettings = SettingsManager.readLoadLocalisationsSettings(0).toBuilder();
    }
    // String tmp = loadSettings.getLocalisationsFilename();
    loadSettings.setLocalisationsFilename(benchmarkFile);
    // Ignore fields that are not required,
    // e.g. the dataset name
    final boolean hide = loadSettings.getHideFieldDatasetName();
    loadSettings.setHideFieldDatasetName(true);
    final LocalisationList localisations = LoadLocalisations.loadLocalisations(loadSettings);
    loadSettings.setHideFieldDatasetName(hide);
    SettingsManager.writeSettings(loadSettings.build());
    if (localisations == null || localisations.isEmpty()) {
        return null;
    }
    return localisations.toPeakResults("Dummy");
}
Also used : LocalisationList(uk.ac.sussex.gdsc.smlm.ij.plugins.LoadLocalisations.LocalisationList) MemoryPeakResults(uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults) ImmutableMemoryPeakResults(uk.ac.sussex.gdsc.smlm.results.ImmutableMemoryPeakResults) PeakResultsReader(uk.ac.sussex.gdsc.smlm.results.PeakResultsReader)

Aggregations

LocalisationList (uk.ac.sussex.gdsc.smlm.ij.plugins.LoadLocalisations.LocalisationList)1 ImmutableMemoryPeakResults (uk.ac.sussex.gdsc.smlm.results.ImmutableMemoryPeakResults)1 MemoryPeakResults (uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults)1 PeakResultsReader (uk.ac.sussex.gdsc.smlm.results.PeakResultsReader)1