Search in sources :

Example 1 with IdPeakResult

use of gdsc.smlm.results.IdPeakResult in project GDSC-SMLM by aherbert.

the class PulseActivationAnalysis method createResult.

private IdPeakResult createResult(int t, float x, float y) {
    // We add them as if tracing is perfect. So each peak result has a new ID.
    // This allows the output of the simulation to be used directly by the pulse analysis code.
    IdPeakResult r = new IdPeakResult(t, x, y, 1, 1, ++id);
    // So it appears calibrated
    r.noise = 1;
    return r;
}
Also used : IdPeakResult(gdsc.smlm.results.IdPeakResult)

Example 2 with IdPeakResult

use of gdsc.smlm.results.IdPeakResult in project GDSC-SMLM by aherbert.

the class ResultsManagerTest method extract.

private MemoryPeakResults extract(Spot[] spots, int channel, int slice, int position, int type) {
    MemoryPeakResults results = new MemoryPeakResults();
    for (Spot spot : spots) {
        if (spot.getChannel() == channel && spot.getSlice() == slice && spot.getPos() == position && spot.getFluorophoreType() == type) {
            int id = spot.getCluster();
            int startFrame = spot.getFrame();
            int origX = spot.getXPosition();
            int origY = spot.getYPosition();
            float origValue = 0;
            double error = 0;
            float noise = 0;
            float[] params = new float[7];
            params[Gaussian2DFunction.BACKGROUND] = spot.getBackground();
            params[Gaussian2DFunction.SIGNAL] = spot.getIntensity();
            params[Gaussian2DFunction.X_POSITION] = spot.getX();
            params[Gaussian2DFunction.Y_POSITION] = spot.getY();
            params[Gaussian2DFunction.X_SD] = params[Gaussian2DFunction.Y_SD] = spot.getWidth() / TSFPeakResultsWriter.SD_TO_FWHM_FACTOR;
            float[] paramsStdDev = null;
            IdPeakResult peak = new IdPeakResult(startFrame, origX, origY, origValue, error, noise, params, paramsStdDev, id);
            results.add(peak);
        }
    }
    return results;
}
Also used : Spot(gdsc.smlm.tsf.TaggedSpotFile.Spot) IdPeakResult(gdsc.smlm.results.IdPeakResult) MemoryPeakResults(gdsc.smlm.results.MemoryPeakResults)

Aggregations

IdPeakResult (gdsc.smlm.results.IdPeakResult)2 MemoryPeakResults (gdsc.smlm.results.MemoryPeakResults)1 Spot (gdsc.smlm.tsf.TaggedSpotFile.Spot)1