Search in sources :

Example 51 with Checkbox

use of java.awt.Checkbox in project GDSC-SMLM by aherbert.

the class FreeFilterResults method showDialog.

private boolean showDialog() {
    final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
    gd.addHelp(HelpUrls.getUrl("free-filter-results"));
    gd.addMessage("Select a dataset to filter");
    ResultsManager.addInput(gd, inputOptionRef.get(), InputSource.MEMORY);
    filterSettings = SettingsManager.readGuiFilterSettings(0).toBuilder();
    String text;
    try {
        text = uk.ac.sussex.gdsc.core.utils.XmlUtils.prettyPrintXml(filterSettings.getFreeFilter());
    } catch (final Exception ex) {
        text = filterSettings.getFreeFilter();
    }
    gd.addTextAreas(text, null, 20, 80);
    gd.addCheckbox("Show_demo_filters", false);
    if (ImageJUtils.isShowGenericDialog()) {
        final Checkbox cb = (Checkbox) gd.getCheckboxes().get(0);
        cb.addItemListener(this::itemStateChanged);
    }
    gd.showDialog();
    if (gd.wasCanceled()) {
        return false;
    }
    inputOption = ResultsManager.getInputSource(gd);
    filterSettings.setFreeFilter(gd.getNextText());
    final boolean demoFilters = gd.getNextBoolean();
    if (demoFilters) {
        logDemoFilters(TITLE);
        return false;
    }
    inputOptionRef.set(inputOption);
    return SettingsManager.writeSettings(filterSettings.build());
}
Also used : Checkbox(java.awt.Checkbox) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog)

Example 52 with Checkbox

use of java.awt.Checkbox in project GDSC-SMLM by aherbert.

the class DoubletAnalysis method showAnalysisDialog.

/**
 * Show analysis dialog.
 *
 * @return true, if successful
 */
private boolean showAnalysisDialog() {
    final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
    gd.addHelp(HelpUrls.getUrl("doublet-filter-analysis"));
    settings = Settings.load();
    config = configRef.get().createCopy();
    final StringBuilder sb = new StringBuilder("Filters the doublet fits and reports the performance increase\n");
    // Show the fitting settings that will effect filters, i.e. fit standard deviation, fit width
    final FitConfiguration fitConfig = config.getFitConfiguration();
    sb.append("SD0 = ").append(MathUtils.rounded(fitConfig.getInitialXSd())).append("\n");
    // sb.append("SD1 =
    // ").append(MathUtils.rounded(fitConfig.getInitialPeakStdDev1())).append("\n");
    sb.append("Fit Width = ").append(config.getFittingWidth()).append("\n");
    gd.addMessage(sb.toString());
    // Collect options for filtering
    gd.addChoice("Selection_Criteria", Settings.SELECTION_CRITERIAS, settings.selectionCriteria);
    filterFitConfig = filterFitConfigRef.get().createCopy();
    // Copy the settings used when fitting
    filterFitConfig.setCalibration(fitConfig.getCalibration());
    filterFitConfig.setPsf(fitConfig.getPsf());
    filterFitConfig.setFitSolverSettings(fitConfig.getFitSolverSettings());
    final String[] templates = ConfigurationTemplate.getTemplateNames(true);
    gd.addChoice("Template", templates, templates[0]);
    // Allow the settings from the benchmark analysis to be used
    gd.addCheckbox("Benchmark_settings", settings.analysisUseBenchmarkSettings);
    gd.addCheckbox("Smart_filter", filterFitConfig.isSmartFilter());
    gd.addSlider("Shift_factor", 0.01, 2, filterFitConfig.getCoordinateShiftFactor());
    gd.addNumericField("Signal_strength", filterFitConfig.getSignalStrength(), 2);
    gd.addNumericField("Min_photons", filterFitConfig.getMinPhotons(), 0);
    gd.addSlider("Min_width_factor", 0, 0.99, filterFitConfig.getMinWidthFactor());
    gd.addSlider("Max_width_factor", 1.01, 5, filterFitConfig.getMaxWidthFactor());
    gd.addNumericField("Precision", filterFitConfig.getPrecisionThreshold(), 2);
    gd.addChoice("Precision_method", SettingsManager.getPrecisionMethodNames(), filterFitConfig.getPrecisionMethod().ordinal());
    gd.addNumericField("Drift_angle", settings.analysisDriftAngle, 2);
    gd.addNumericField("Min_gap", settings.minGap, 2);
    // Collect display options
    gd.addCheckbox("Show_results", settings.analysisShowResults);
    gd.addCheckbox("Show_Jaccard_Plot", settings.showJaccardPlot);
    gd.addCheckbox("Use_max_residuals", settings.useMaxResiduals);
    gd.addCheckbox("Logging", settings.analysisLogging);
    gd.addStringField("Title", settings.analysisTitle);
    gd.addCheckbox("Save_template", settings.saveTemplate);
    // Add a mouse listener to the config file field
    if (ImageJUtils.isShowGenericDialog()) {
        final Vector<TextField> numerics = gd.getNumericFields();
        final Vector<Checkbox> checkboxes = gd.getCheckboxes();
        final Vector<Choice> choices = gd.getChoices();
        choices.get(1).addItemListener(this);
        checkboxes.get(0).addItemListener(this);
        cbSmartFilter = checkboxes.get(1);
        final Iterator<TextField> nu = numerics.iterator();
        textCoordinateShiftFactor = nu.next();
        textSignalStrength = nu.next();
        textMinPhotons = nu.next();
        textMinWidthFactor = nu.next();
        textWidthFactor = nu.next();
        textPrecisionThreshold = nu.next();
        textPrecisionMethod = choices.get(2);
    }
    gd.addHelp(HelpUrls.getUrl("doublet-filter-analysis"));
    gd.showDialog();
    if (gd.wasCanceled()) {
        return false;
    }
    if (gd.invalidNumber()) {
        return false;
    }
    settings.selectionCriteria = gd.getNextChoiceIndex();
    // Ignore the template
    gd.getNextChoice();
    settings.analysisUseBenchmarkSettings = gd.getNextBoolean();
    filterFitConfig.setSmartFilter(gd.getNextBoolean());
    filterFitConfig.setCoordinateShiftFactor(gd.getNextNumber());
    filterFitConfig.setSignalStrength(gd.getNextNumber());
    filterFitConfig.setMinPhotons(gd.getNextNumber());
    filterFitConfig.setMinWidthFactor(gd.getNextNumber());
    filterFitConfig.setMaxWidthFactor(gd.getNextNumber());
    filterFitConfig.setPrecisionThreshold(gd.getNextNumber());
    filterFitConfig.setPrecisionMethod(gd.getNextChoiceIndex());
    settings.analysisDriftAngle = gd.getNextNumber();
    settings.minGap = gd.getNextNumber();
    settings.analysisShowResults = gd.getNextBoolean();
    settings.showJaccardPlot = gd.getNextBoolean();
    settings.useMaxResiduals = gd.getNextBoolean();
    settings.analysisLogging = gd.getNextBoolean();
    settings.analysisTitle = gd.getNextString();
    settings.saveTemplate = gd.getNextBoolean();
    settings.save();
    filterFitConfigRef.set(filterFitConfig);
    if (gd.invalidNumber()) {
        return false;
    }
    if (settings.analysisUseBenchmarkSettings) {
        return updateFilterConfiguration(filterFitConfig);
    } else if (filterFitConfig.isSmartFilter()) {
        return PeakFit.configureSmartFilter(filterFitConfig);
    }
    return true;
}
Also used : Choice(java.awt.Choice) FitConfiguration(uk.ac.sussex.gdsc.smlm.engine.FitConfiguration) Checkbox(java.awt.Checkbox) TextField(java.awt.TextField) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog)

Example 53 with Checkbox

use of java.awt.Checkbox in project GDSC-SMLM by aherbert.

the class ResultsManager method showDialog.

private boolean showDialog() {
    final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
    gd.addHelp(HelpUrls.getUrl("results-manager"));
    settings = Settings.load();
    resultsSettings = SettingsManager.readResultsSettings(0).toBuilder();
    gd.addMessage("Read the Peak Results and output to a new format");
    gd.addMessage("Select the Peak Results");
    addInput(gd, INPUT_NAME, settings.inputOption, new FilenameLoadOption[] { new FilenameLoadOption(settings.inputFilename) }, InputSource.MEMORY, InputSource.FILE);
    final Choice inputChoice = gd.getLastChoice();
    addTableResultsOptions(gd, resultsSettings, FLAG_TABLE_FORMAT);
    addImageResultsOptions(gd, resultsSettings);
    addFileResultsOptions(gd, resultsSettings, 0);
    addInMemoryResultsOptions(gd, resultsSettings);
    final Label messageLabel = (Label) gd.getMessage();
    final Checkbox saveCheckbox = gd.getLastCheckbox();
    // Hide the in-memory settings if the input is not a file
    if (ImageJUtils.isShowGenericDialog()) {
        final Label saveLabel = gd.getLastLabel();
        final ItemListener listener = event -> {
            final boolean enable = INPUT_FILE.equals(inputChoice.getSelectedItem());
            if (enable != messageLabel.isVisible()) {
                messageLabel.setVisible(enable);
                saveCheckbox.setVisible(enable);
                saveLabel.setVisible(enable);
                gd.pack();
            }
        };
        // Run once to set up
        listener.itemStateChanged(null);
        inputChoice.addItemListener(listener);
    }
    gd.showDialog();
    if (gd.wasCanceled()) {
        return false;
    }
    settings.inputOption = ResultsManager.getInputSource(gd);
    settings.inputFilename = gd.getNextString();
    resultsSettings.getResultsTableSettingsBuilder().setResultsTableFormatValue(gd.getNextChoiceIndex());
    resultsSettings.getResultsImageSettingsBuilder().setImageTypeValue(gd.getNextChoiceIndex());
    resultsSettings.getResultsFileSettingsBuilder().setFileFormatValue(gd.getNextChoiceIndex());
    resultsSettings.getResultsFileSettingsBuilder().setResultsFilename(gd.getNextString());
    resultsSettings.getResultsInMemorySettingsBuilder().setInMemory(gd.getNextBoolean());
    gd.collectOptions();
    // Check arguments
    try {
        final ResultsImageSettings.Builder imageSettings = resultsSettings.getResultsImageSettingsBuilder();
        if (imageSettings.getImageType() == ResultsImageType.DRAW_INTENSITY_AVERAGE_PRECISION || imageSettings.getImageType() == ResultsImageType.DRAW_LOCALISATIONS_AVERAGE_PRECISION) {
            ParameterUtils.isAboveZero("Image precision", imageSettings.getAveragePrecision());
        }
        ParameterUtils.isAboveZero("Image scale", imageSettings.getScale());
        if (extraOptions) {
            ParameterUtils.isPositive("Image rolling window", imageSettings.getRollingWindowSize());
        }
    } catch (final IllegalArgumentException ex) {
        IJ.error(TITLE, ex.getMessage());
        return false;
    }
    settings.save();
    SettingsManager.writeSettings(resultsSettings.build());
    return true;
}
Also used : Choice(java.awt.Choice) Java2(ij.util.Java2) Arrays(java.util.Arrays) Rectangle2D(java.awt.geom.Rectangle2D) ItemListener(java.awt.event.ItemListener) StringUtils(org.apache.commons.lang3.StringUtils) ResultsImageSettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsImageSettings) ResultsSettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsSettings) Panel(java.awt.Panel) ImageJPluginLoggerHelper(uk.ac.sussex.gdsc.core.ij.ImageJPluginLoggerHelper) YesNoCancelDialog(ij.gui.YesNoCancelDialog) MemoryPeakResults(uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults) ResultOption(uk.ac.sussex.gdsc.smlm.results.ResultOption) Map(java.util.Map) ImageJImagePeakResults(uk.ac.sussex.gdsc.smlm.ij.results.ImageJImagePeakResults) PeakResults(uk.ac.sussex.gdsc.smlm.results.PeakResults) JFileChooser(javax.swing.JFileChooser) MathUtils(uk.ac.sussex.gdsc.core.utils.MathUtils) CalibrationWriter(uk.ac.sussex.gdsc.smlm.data.config.CalibrationWriter) EnumSet(java.util.EnumSet) LutHelper(uk.ac.sussex.gdsc.core.ij.process.LutHelper) SettingsManager(uk.ac.sussex.gdsc.smlm.ij.settings.SettingsManager) CameraType(uk.ac.sussex.gdsc.smlm.data.config.CalibrationProtos.CameraType) Predicate(java.util.function.Predicate) Collection(java.util.Collection) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog) ResultsInMemorySettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsInMemorySettings) PeakResultsList(uk.ac.sussex.gdsc.smlm.results.PeakResultsList) Set(java.util.Set) ResultsImageType(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsImageType) DistanceUnit(uk.ac.sussex.gdsc.smlm.data.config.UnitProtos.DistanceUnit) Logger(java.util.logging.Logger) TextUtils(uk.ac.sussex.gdsc.core.utils.TextUtils) BitFlagUtils(uk.ac.sussex.gdsc.core.utils.BitFlagUtils) List(java.util.List) Builder(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsSettings.Builder) PeakResultTableModelFrame(uk.ac.sussex.gdsc.smlm.ij.gui.PeakResultTableModelFrame) BinaryFilePeakResults(uk.ac.sussex.gdsc.smlm.results.BinaryFilePeakResults) FileUtils(uk.ac.sussex.gdsc.core.utils.FileUtils) PlugIn(ij.plugin.PlugIn) Rectangle(java.awt.Rectangle) PeakResultProcedureX(uk.ac.sussex.gdsc.smlm.results.procedures.PeakResultProcedureX) Prefs(ij.Prefs) ValidationUtils(uk.ac.sussex.gdsc.core.utils.ValidationUtils) HashMap(java.util.HashMap) IntensityUnit(uk.ac.sussex.gdsc.smlm.data.config.UnitProtos.IntensityUnit) FixedPeakResultList(uk.ac.sussex.gdsc.smlm.results.FixedPeakResultList) ResultsFileSettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsFileSettings) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) OptionListener(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog.OptionListener) OpenDialog(ij.io.OpenDialog) ArrayList(java.util.ArrayList) IJImageSource(uk.ac.sussex.gdsc.smlm.ij.IJImageSource) MultiDialog(uk.ac.sussex.gdsc.core.ij.gui.MultiDialog) ResultsProtosHelper(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtosHelper) ResultsFileFormat(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsFileFormat) ImagePeakResultsFactory(uk.ac.sussex.gdsc.smlm.ij.results.ImagePeakResultsFactory) GenericDialog(ij.gui.GenericDialog) PeakResultTableModel(uk.ac.sussex.gdsc.smlm.ij.gui.PeakResultTableModel) MalkFilePeakResults(uk.ac.sussex.gdsc.smlm.results.MalkFilePeakResults) PeakResultsReader(uk.ac.sussex.gdsc.smlm.results.PeakResultsReader) LinkedHashSet(java.util.LinkedHashSet) TsfPeakResultsWriter(uk.ac.sussex.gdsc.smlm.results.TsfPeakResultsWriter) EventQueue(java.awt.EventQueue) ResultsTableFormat(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsTableFormat) SimpleImageJTrackProgress(uk.ac.sussex.gdsc.core.ij.SimpleImageJTrackProgress) Checkbox(java.awt.Checkbox) Label(java.awt.Label) IOException(java.io.IOException) ResultsImageMode(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsImageMode) Recorder(ij.plugin.frame.Recorder) File(java.io.File) Constants(uk.ac.sussex.gdsc.smlm.ij.settings.Constants) ImageJTablePeakResults(uk.ac.sussex.gdsc.smlm.ij.results.ImageJTablePeakResults) Counter(uk.ac.sussex.gdsc.smlm.results.count.Counter) ImageJUtils(uk.ac.sussex.gdsc.core.ij.ImageJUtils) TextFilePeakResults(uk.ac.sussex.gdsc.smlm.results.TextFilePeakResults) IJ(ij.IJ) ExtendedPeakResult(uk.ac.sussex.gdsc.smlm.results.ExtendedPeakResult) ResultsTableSettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsTableSettings) LocalList(uk.ac.sussex.gdsc.core.utils.LocalList) Choice(java.awt.Choice) Checkbox(java.awt.Checkbox) Label(java.awt.Label) ItemListener(java.awt.event.ItemListener) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog) ResultsImageSettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsImageSettings)

Example 54 with Checkbox

use of java.awt.Checkbox in project GDSC-SMLM by aherbert.

the class PsfCreator method showAlignmentDialog.

private boolean showAlignmentDialog() {
    final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
    gd.addHelp(HelpUrls.getUrl("psf-creator"));
    gd.addMessage("Use XYZ stack alignment to create a combined PSF");
    final CalibrationWriter cw = CalibrationWriter.create(settings.getCalibration());
    // These are ignored for reset
    gd.addChoice("Alignment_mode", ALIGNMENT_MODE, settings.getAlignmentMode());
    gd.addSlider("Z_radius (px)", 0, imp.getStackSize(), settings.getAlignmentZRadius());
    gd.addChoice("PSF_type", PSF_TYPE, settings.getPsfType());
    gd.addNumericField("nm_per_pixel", cw.getNmPerPixel(), 2, 6, "nm");
    gd.addNumericField("nm_per_slice", settings.getNmPerSlice(), 0, 6, "nm");
    PeakFit.addCameraOptions(gd, PeakFit.FLAG_NO_GAIN | PeakFit.FLAG_NO_READ_NOISE, cw);
    // For reset
    final LocalList<TextField> tf = new LocalList<>();
    final LocalList<Checkbox> cb = new LocalList<>();
    tf.add(gd.addAndGetSlider("Analysis_window", 0, 8, settings.getAnalysisWindow()));
    tf.add(gd.addAndGetSlider("Smoothing", 0.1, 0.5, settings.getSmoothing()));
    tf.add(gd.addAndGetSlider("CoM_z_window", 0, 8, settings.getComWindow()));
    tf.add(gd.addAndGetSlider("CoM_border", 0, 0.5, settings.getComBorder()));
    tf.add(gd.addAndGetSlider("Alignment_magnification", 1, 8, settings.getAlignmentMagnification()));
    cb.add(gd.addAndGetCheckbox("Smooth_stack_signal", settings.getSmoothStackSignal()));
    tf.add(gd.addAndGetSlider("Max_iterations", 1, 20, settings.getMaxIterations()));
    if (settings.getInteractiveMode()) {
        cb.add(gd.addAndGetCheckbox("Check_alignments", settings.getCheckAlignments()));
    }
    tf.add(gd.addAndGetNumericField("Sub-pixel_precision", settings.getSubPixelPrecision(), -2));
    if (!settings.getInteractiveMode()) {
        tf.add(gd.addAndGetNumericField("RMSD_XY_threshold", settings.getRmsdXyThreshold(), -2));
        tf.add(gd.addAndGetNumericField("RMSD_Z_threshold", settings.getRmsdZThreshold(), -2));
        tf.add(gd.addAndGetNumericField("CoM_shift_threshold", settings.getComShiftThreshold(), -2));
    }
    if (ImageJUtils.isShowGenericDialog()) {
        gd.addAndGetButton("Reset", event -> {
            final boolean interactive = PsfCreator.this.settings.getInteractiveMode();
            final PSFCreatorSettings defaults = GuiProtosHelper.defaultPSFCreatorSettings;
            int ti = 0;
            int cbi = 0;
            tf.get(ti++).setText(Double.toString(defaults.getAnalysisWindow()));
            tf.get(ti++).setText(Double.toString(defaults.getSmoothing()));
            tf.get(ti++).setText(Integer.toString(defaults.getComWindow()));
            tf.get(ti++).setText(Double.toString(defaults.getComBorder()));
            tf.get(ti++).setText(Integer.toString(defaults.getAlignmentMagnification()));
            cb.get(cbi++).setState(defaults.getSmoothStackSignal());
            tf.get(ti++).setText(Integer.toString(defaults.getMaxIterations()));
            if (interactive) {
                cb.get(cbi++).setState(defaults.getCheckAlignments());
            }
            tf.get(ti++).setText(Double.toString(defaults.getSubPixelPrecision()));
            if (!interactive) {
                tf.get(ti++).setText(Double.toString(defaults.getRmsdXyThreshold()));
                tf.get(ti++).setText(Double.toString(defaults.getRmsdZThreshold()));
                tf.get(ti++).setText(Double.toString(defaults.getComShiftThreshold()));
            }
            // Reset later options too
            PsfCreator.this.settings.setPsfMagnification(defaults.getPsfMagnification());
            PsfCreator.this.settings.setWindow(defaults.getWindow());
            PsfCreator.this.settings.setSmoothStackSignal(defaults.getSmoothStackSignal());
            PsfCreator.this.settings.setComBorder(defaults.getComBorder());
            PsfCreator.this.settings.setCropBorder(0);
            PsfCreator.this.settings.setCropStart(0);
            PsfCreator.this.settings.setCropEnd(0);
        });
    }
    gd.showDialog();
    if (gd.wasCanceled()) {
        return false;
    }
    settings.setAlignmentMode(gd.getNextChoiceIndex());
    settings.setAlignmentZRadius((int) gd.getNextNumber());
    settings.setPsfType(gd.getNextChoiceIndex());
    cw.setNmPerPixel(gd.getNextNumber());
    settings.setNmPerSlice(gd.getNextNumber());
    cw.setCameraType(SettingsManager.getCameraTypeValues()[gd.getNextChoiceIndex()]);
    settings.setAnalysisWindow((int) gd.getNextNumber());
    settings.setSmoothing(gd.getNextNumber());
    settings.setComWindow((int) gd.getNextNumber());
    settings.setComBorder(gd.getNextNumber());
    settings.setAlignmentMagnification((int) gd.getNextNumber());
    settings.setSmoothStackSignal(gd.getNextBoolean());
    settings.setMaxIterations((int) gd.getNextNumber());
    if (settings.getInteractiveMode()) {
        checkAlignments = gd.getNextBoolean();
        settings.setCheckAlignments(checkAlignments);
    }
    settings.setSubPixelPrecision(gd.getNextNumber());
    if (!settings.getInteractiveMode()) {
        settings.setRmsdXyThreshold(gd.getNextNumber());
        settings.setRmsdZThreshold(gd.getNextNumber());
        settings.setComShiftThreshold(gd.getNextNumber());
    }
    gd.collectOptions();
    nmPerPixel = cw.getNmPerPixel();
    settings.setCalibration(cw.getBuilder());
    SettingsManager.writeSettings(settings);
    // Check arguments
    try {
        ParameterUtils.isPositive("nm/pixel", nmPerPixel);
        ParameterUtils.isPositive("nm/slice", settings.getNmPerSlice());
        // Since we do a local background estimation for each extracted PSF then we
        // do not need the bias for non sCMOS cameras.
        // if (!cw.isSCMOS())
        // Parameters.isAboveZero("Bias", cw.getBias());
        ParameterUtils.isEqualOrAbove("Projection magnification", settings.getAlignmentMagnification(), 1);
        ParameterUtils.isEqualOrAbove("Max iterations", settings.getMaxIterations(), 1);
        ParameterUtils.isEqualOrAbove("PSF magnification", settings.getPsfMagnification(), 1);
        ParameterUtils.isAbove("Smoothing", settings.getSmoothing(), 0);
        ParameterUtils.isBelow("Smoothing", settings.getSmoothing(), 1);
    } catch (final IllegalArgumentException ex) {
        IJ.error(TITLE, ex.getMessage());
        return false;
    }
    return true;
}
Also used : LocalList(uk.ac.sussex.gdsc.core.utils.LocalList) PSFCreatorSettings(uk.ac.sussex.gdsc.smlm.ij.settings.GUIProtos.PSFCreatorSettings) Checkbox(java.awt.Checkbox) CalibrationWriter(uk.ac.sussex.gdsc.smlm.data.config.CalibrationWriter) TextField(java.awt.TextField) NonBlockingExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.NonBlockingExtendedGenericDialog) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog) Point(java.awt.Point) BasePoint(uk.ac.sussex.gdsc.core.match.BasePoint)

Aggregations

Checkbox (java.awt.Checkbox)54 TextField (java.awt.TextField)21 Choice (java.awt.Choice)18 GenericDialog (ij.gui.GenericDialog)13 ExtendedGenericDialog (uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog)11 Vector (java.util.Vector)9 Component (java.awt.Component)8 Label (java.awt.Label)8 GlobalSettings (gdsc.smlm.ij.settings.GlobalSettings)7 Panel (java.awt.Panel)7 GridBagLayout (java.awt.GridBagLayout)5 SOCGameOption (soc.game.SOCGameOption)5 BasePoint (gdsc.core.match.BasePoint)4 PeakResultPoint (gdsc.smlm.ij.plugins.ResultsMatchCalculator.PeakResultPoint)4 Color (java.awt.Color)4 GridBagConstraints (java.awt.GridBagConstraints)4 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 CalibrationWriter (uk.ac.sussex.gdsc.smlm.data.config.CalibrationWriter)4 FitConfiguration (uk.ac.sussex.gdsc.smlm.engine.FitConfiguration)4