Search in sources :

Example 86 with MemoryPeakResults

use of gdsc.smlm.results.MemoryPeakResults 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

MemoryPeakResults (gdsc.smlm.results.MemoryPeakResults)86 PeakResult (gdsc.smlm.results.PeakResult)40 Rectangle (java.awt.Rectangle)16 ArrayList (java.util.ArrayList)13 ExtendedPeakResult (gdsc.smlm.results.ExtendedPeakResult)10 ImagePlus (ij.ImagePlus)10 StoredDataStatistics (gdsc.core.utils.StoredDataStatistics)8 Statistics (gdsc.core.utils.Statistics)7 IJImageSource (gdsc.smlm.ij.IJImageSource)7 Calibration (gdsc.smlm.results.Calibration)7 ExtendedGenericDialog (ij.gui.ExtendedGenericDialog)7 FractionClassificationResult (gdsc.core.match.FractionClassificationResult)6 IJImagePeakResults (gdsc.smlm.ij.results.IJImagePeakResults)6 Trace (gdsc.smlm.results.Trace)6 LinkedList (java.util.LinkedList)6 BasePoint (gdsc.core.match.BasePoint)5 ImageStack (ij.ImageStack)5 Plot2 (ij.gui.Plot2)5 Point (java.awt.Point)5 ClusterPoint (gdsc.core.clustering.ClusterPoint)4