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;
}
Aggregations