use of uk.ac.sussex.gdsc.smlm.engine.FitConfiguration in project GDSC-SMLM by aherbert.
the class PeakFit method configureSmartFilter.
/**
* Show a dialog to configure the smart filter. The updated settings are optionally saved to the
* settings file.
*
* <p>If the fit configuration isSmartFilter is not enabled then this method returns true. If it
* is enabled then a dialog is shown to input the configuration for a smart filter. If no valid
* filter can be created from the input then the method returns false.
*
* <p>Note: If the smart filter is successfully configured then the user may want to disable the
* standard fit validation.
*
* @param config the config
* @param flags the flags
* @return true, if successful
*/
public static boolean configureSmartFilter(FitEngineConfiguration config, int flags) {
final FitConfiguration fitConfig = config.getFitConfiguration();
if (!fitConfig.isSmartFilter()) {
return true;
}
final boolean result = configureSmartFilter(fitConfig);
if (result) {
if (BitFlagUtils.anyNotSet(flags, FLAG_NO_SAVE)) {
SettingsManager.writeSettings(config, 0);
}
}
return result;
}
use of uk.ac.sussex.gdsc.smlm.engine.FitConfiguration in project GDSC-SMLM by aherbert.
the class PsfCalculator method run.
@Override
public void run(String arg) {
SmlmUsageTracker.recordPlugin(this.getClass(), arg);
final PSFCalculatorSettings settings = SettingsManager.readPsfCalculatorSettings(0);
final double sd = calculate(settings, false);
if (sd < 0) {
return;
}
SettingsManager.writeSettings(this.settingsBuilder);
final FitEngineConfiguration config = SettingsManager.readFitEngineConfiguration(0);
final FitConfiguration fitConfig = config.getFitConfiguration();
fitConfig.setNmPerPixel(getPixelPitch());
fitConfig.setPsfType(PSFType.ONE_AXIS_GAUSSIAN_2D);
fitConfig.setInitialPeakStdDev(sd);
SettingsManager.writeSettings(config, 0);
}
Aggregations