use of uk.ac.sussex.gdsc.smlm.filters.SpotFilter in project GDSC-SMLM by aherbert.
the class PeakFit method createFitEngine.
/**
* Creates a fitting engine using the current configuration.
*
* @param numberOfThreads the number of threads
* @param queue the queue
* @param queueSize the queue size
* @return The fiting engine
*/
public FitEngine createFitEngine(int numberOfThreads, FitQueue queue, int queueSize) {
// Ensure thread safety
final PeakResultsList list = (numberOfThreads > 1) ? results.getThreadSafeList() : results;
// Reduce to single object for speed
final PeakResults r = (results.numberOfOutputs() == 1) ? list.toArray()[0] : list;
// Update the configuration
if (!updateFitConfiguration(config)) {
return null;
}
final FitEngine engine = FitEngine.create(config, r, numberOfThreads, queue, queueSize);
// Write settings out to the IJ log
if (resultsSettings.getLogProgress()) {
IJ.log(LOG_SPACER);
IJ.log("Peak Fit");
IJ.log(LOG_SPACER);
ImageJUtils.log("Initial Peak SD = %s,%s", MathUtils.rounded(fitConfig.getInitialXSd()), MathUtils.rounded(fitConfig.getInitialYSd()));
final SpotFilter spotFilter = engine.getSpotFilter();
IJ.log("Spot Filter = " + spotFilter.getDescription());
final int w = 2 * engine.getFitting() + 1;
ImageJUtils.log("Fit window = %d x %d", w, w);
if (!fitConfig.isDisableSimpleFilter()) {
IJ.log("Coordinate shift = " + MathUtils.rounded(config.getFitConfiguration().getCoordinateShift()));
IJ.log("Signal strength = " + MathUtils.rounded(fitConfig.getSignalStrength()));
}
if (fitConfig.isDirectFilter()) {
IJ.log("Smart filter = " + fitConfig.getSmartFilter().getDescription());
}
if (extraOptions) {
IJ.log("Noise = " + MathUtils.rounded(fitConfig.getNoise()));
}
IJ.log("Width factor = " + MathUtils.rounded(fitConfig.getMaxWidthFactor()));
IJ.log(LOG_SPACER);
}
return engine;
}
Aggregations