Search in sources :

Example 6 with Spot

use of gdsc.smlm.tsf.TaggedSpotFile.Spot 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

Spot (gdsc.smlm.tsf.TaggedSpotFile.Spot)6 Builder (gdsc.smlm.tsf.TaggedSpotFile.Spot.Builder)3 MemoryPeakResults (gdsc.smlm.results.MemoryPeakResults)2 IOException (java.io.IOException)2 IdPeakResult (gdsc.smlm.results.IdPeakResult)1 FitMode (gdsc.smlm.tsf.TaggedSpotFile.FitMode)1 FluorophoreType (gdsc.smlm.tsf.TaggedSpotFile.FluorophoreType)1 IntensityUnits (gdsc.smlm.tsf.TaggedSpotFile.IntensityUnits)1 LocationUnits (gdsc.smlm.tsf.TaggedSpotFile.LocationUnits)1 SpotList (gdsc.smlm.tsf.TaggedSpotFile.SpotList)1 ThetaUnits (gdsc.smlm.tsf.TaggedSpotFile.ThetaUnits)1 DataOutputStream (java.io.DataOutputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 RandomAccessFile (java.io.RandomAccessFile)1