Search in sources :

Example 1 with IdPeakResult

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

the class PulseActivationAnalysis method createResult.

private IdPeakResult createResult(int time, 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.
    final IdPeakResult r = new IdPeakResult(time, x, y, 1, ++nextPeakResultId);
    // So it appears calibrated
    r.setNoise(1);
    return r;
}
Also used : IdPeakResult(uk.ac.sussex.gdsc.smlm.results.IdPeakResult)

Example 2 with IdPeakResult

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

the class ResultsManagerTest method extract.

private static MemoryPeakResults extract(Spot[] spots, int channel, int slice, int position, int type) {
    final MemoryPeakResults results = new MemoryPeakResults(PsfHelper.create(PSFType.ONE_AXIS_GAUSSIAN_2D));
    for (final Spot spot : spots) {
        if (spot.getChannel() == channel && spot.getSlice() == slice && spot.getPos() == position && spot.getFluorophoreType() == type) {
            final int id = spot.getCluster();
            final int startFrame = spot.getFrame();
            final int origX = spot.getXPosition();
            final int origY = spot.getYPosition();
            final float origValue = 0;
            final double error = 0;
            final float noise = 0;
            final float[] params = Gaussian2DPeakResultHelper.createOneAxisParams(spot.getBackground(), spot.getIntensity(), spot.getX(), spot.getY(), spot.getZ(), (float) (spot.getWidth() / Gaussian2DFunction.SD_TO_FWHM_FACTOR));
            final float[] paramsStdDev = null;
            final IdPeakResult peak = new IdPeakResult(startFrame, origX, origY, origValue, error, noise, 0, params, paramsStdDev, id);
            results.add(peak);
        }
    }
    return results;
}
Also used : Spot(uk.ac.sussex.gdsc.smlm.tsf.TSFProtos.Spot) IdPeakResult(uk.ac.sussex.gdsc.smlm.results.IdPeakResult) MemoryPeakResults(uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults)

Example 3 with IdPeakResult

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

the class FitWorker method createResult.

private PeakResult createResult(int origX, int origY, float origValue, double error, float noise, float meanIntensity, float[] params, float[] paramDevs, int id, double precision) {
    // Convert to a variable PSF parameter PeakResult
    params = Gaussian2DPeakResultHelper.createParams(psfType, params);
    if (paramDevs != null) {
        paramDevs = Gaussian2DPeakResultHelper.createParams(psfType, paramDevs);
        // Convert variances to standard deviations
        for (int i = 0; i < paramDevs.length; i++) {
            paramDevs[i] = (float) Math.sqrt(paramDevs[i]);
        }
    }
    if (precision > 0) {
        final AttributePeakResult r = new AttributePeakResult(slice, origX, origY, origValue, error, noise, meanIntensity, params, paramDevs);
        r.setId(id);
        r.setPrecision(precision);
        if (endT >= 0 && slice != endT) {
            r.setEndFrame(endT);
        }
        return r;
    }
    if (endT >= 0 && slice != endT) {
        return new ExtendedPeakResult(slice, origX, origY, origValue, error, noise, meanIntensity, params, paramDevs, endT, id);
    }
    return new IdPeakResult(slice, origX, origY, origValue, error, noise, meanIntensity, params, paramDevs, id);
}
Also used : ExtendedPeakResult(uk.ac.sussex.gdsc.smlm.results.ExtendedPeakResult) AttributePeakResult(uk.ac.sussex.gdsc.smlm.results.AttributePeakResult) IdPeakResult(uk.ac.sussex.gdsc.smlm.results.IdPeakResult)

Aggregations

IdPeakResult (uk.ac.sussex.gdsc.smlm.results.IdPeakResult)3 AttributePeakResult (uk.ac.sussex.gdsc.smlm.results.AttributePeakResult)1 ExtendedPeakResult (uk.ac.sussex.gdsc.smlm.results.ExtendedPeakResult)1 MemoryPeakResults (uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults)1 Spot (uk.ac.sussex.gdsc.smlm.tsf.TSFProtos.Spot)1