Search in sources :

Example 21 with GenericDialog

use of ij.gui.GenericDialog in project GDSC-SMLM by aherbert.

the class GaussianFit method showDialog.

/*
	 * (non-Javadoc)
	 * 
	 * @see ij.plugin.filter.ExtendedPlugInFilter#showDialog(ij.ImagePlus, java.lang.String,
	 * ij.plugin.filter.PlugInFilterRunner)
	 */
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) {
    double[] limits = getLimits(imp.getProcessor());
    double minValue = limits[0];
    double maxValue = limits[1];
    if (background > maxValue)
        background = (int) maxValue;
    if (background < minValue)
        background = (int) minValue;
    GenericDialog gd = new GenericDialog(TITLE);
    gd.addHelp(About.HELP_URL);
    gd.addMessage("Fit 2D Gaussian to identified maxima");
    gd.addMessage("--- Image smoothing ---\n" + "- Within a 2n+1 box\n");
    gd.addSlider("Smoothing", 0, 4.5, smooth);
    gd.addMessage("--- Maxima identification ---\n" + "- Within a 2n+1 box\n");
    gd.addSlider("Box_size", 1, 15, boxSize);
    gd.addSlider("Background", minValue, maxValue, background);
    gd.addSlider("Min_height", 0, maxValue, peakHeight);
    gd.addSlider("Fraction_above_background", 0, 1.01, fractionAboveBackground);
    gd.addSlider("Min_width", 0, 20, peakWidth);
    gd.addSlider("Top_N", 0, 20, topN);
    gd.addCheckbox("Block_find_algorithm", blockFindAlgorithm);
    gd.addCheckbox("Neighbour_check", neighbourCheck);
    gd.addSlider("Border", 0, 15, border);
    gd.addMessage("--- Gaussian fitting ---");
    Component splitLabel = gd.getMessage();
    String[] functionNames = SettingsManager.getNames((Object[]) FitFunction.values());
    gd.addChoice("Fit_function", functionNames, functionNames[fitFunction]);
    gd.addCheckbox("Fit_background", fitBackground);
    String[] criteriaNames = SettingsManager.getNames((Object[]) FitCriteria.values());
    gd.addChoice("Fit_criteria", criteriaNames, criteriaNames[fitCriteria]);
    gd.addNumericField("Max_iterations", maxIterations, 0);
    gd.addNumericField("Significant_digits", significantDigits, 0);
    gd.addNumericField("Coord_delta", delta, 4);
    gd.addCheckbox("Single_fit", singleFit);
    gd.addNumericField("Single_region_size", singleRegionSize, 0);
    gd.addNumericField("Initial_StdDev", initialPeakStdDev, 3);
    gd.addCheckbox("Log_progress", logProgress);
    gd.addCheckbox("Show_deviations", showDeviations);
    gd.addCheckbox("Filter_results", filterResults);
    gd.addCheckbox("Show_fit", showFit);
    gd.addPreviewCheckbox(pfr);
    gd.addDialogListener(this);
    if (gd.getLayout() != null) {
        GridBagLayout grid = (GridBagLayout) gd.getLayout();
        int xOffset = 0, yOffset = 0;
        int lastY = -1, rowCount = 0;
        for (Component comp : gd.getComponents()) {
            // Check if this should be the second major column
            if (comp == splitLabel) {
                xOffset += 2;
                yOffset -= rowCount;
            }
            // Reposition the field
            GridBagConstraints c = grid.getConstraints(comp);
            if (lastY != c.gridy)
                rowCount++;
            lastY = c.gridy;
            c.gridx = c.gridx + xOffset;
            c.gridy = c.gridy + yOffset;
            c.insets.left = c.insets.left + 10 * xOffset;
            c.insets.top = 0;
            c.insets.bottom = 0;
            grid.setConstraints(comp, c);
        }
        if (IJ.isLinux())
            gd.setBackground(new Color(238, 238, 238));
    }
    gd.showDialog();
    if (gd.wasCanceled() || !dialogItemChanged(gd, null)) {
        //			imp.getProcessor().reset();
        imp.setOverlay(null);
        return DONE;
    }
    return flags;
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) GenericDialog(ij.gui.GenericDialog) Color(java.awt.Color) Component(java.awt.Component)

Example 22 with GenericDialog

use of ij.gui.GenericDialog in project GDSC-SMLM by aherbert.

the class LoadLocalisations method getZDepth.

private boolean getZDepth(MemoryPeakResults results) {
    // The z-depth is stored in pixels in the error field
    double min = results.getHead().error;
    double max = min;
    for (PeakResult peak : results.getResults()) {
        if (min > peak.error)
            min = peak.error;
        else if (max < peak.error)
            max = peak.error;
    }
    // No z-depth
    if (min == max && min == 0)
        return true;
    maxz = FastMath.min(maxz, max);
    minz = FastMath.max(minz, min);
    // Display in nm
    final double pp = results.getNmPerPixel();
    min *= pp;
    max *= pp;
    String msg = String.format("%d localisations with %.2f <= z <= %.2f", results.size(), min, max);
    min = Math.floor(min);
    max = Math.ceil(max);
    GenericDialog gd = new GenericDialog(TITLE);
    gd.addMessage(msg);
    gd.addCheckbox("Limit Z-depth", limitZ);
    gd.addSlider("minZ", min, max, minz * pp);
    gd.addSlider("maxZ", min, max, maxz * pp);
    gd.showDialog();
    if (gd.wasCanceled() || gd.invalidNumber()) {
        return false;
    }
    myLimitZ = limitZ = gd.getNextBoolean();
    minz = gd.getNextNumber() / pp;
    maxz = gd.getNextNumber() / pp;
    return true;
}
Also used : GenericDialog(ij.gui.GenericDialog) PeakResult(gdsc.smlm.results.PeakResult) AttributePeakResult(gdsc.smlm.results.AttributePeakResult)

Example 23 with GenericDialog

use of ij.gui.GenericDialog in project GDSC-SMLM by aherbert.

the class LoadLocalisations method getFields.

private static boolean getFields() {
    GenericDialog gd = new GenericDialog(TITLE);
    gd.addMessage("Load delimited localisations");
    gd.addStringField("Dataset_name", name, 30);
    gd.addMessage("Calibration:");
    gd.addNumericField("Pixel_size", pixelPitch, 3, 8, "nm");
    gd.addNumericField("Gain", gain, 3, 8, "Count/photon");
    gd.addNumericField("Exposure_time", exposureTime, 3, 8, "ms");
    gd.addMessage("Records:");
    gd.addNumericField("Header_lines", header, 0);
    gd.addStringField("Comment", comment);
    gd.addStringField("Delimiter", delimiter);
    String[] dUnits = SettingsManager.getNames((Object[]) DistanceUnit.values());
    gd.addChoice("Distance_unit", dUnits, dUnits[distanceUnit]);
    String[] iUnits = SettingsManager.getNames((Object[]) IntensityUnit.values());
    gd.addChoice("Intensity_unit", iUnits, iUnits[intensityUnit]);
    gd.addMessage("Define the fields:");
    Label l = (Label) gd.getMessage();
    gd.addNumericField("T", it, 0);
    gd.addNumericField("ID", iid, 0);
    gd.addNumericField("X", ix, 0);
    gd.addNumericField("Y", iy, 0);
    gd.addNumericField("Z", iz, 0);
    gd.addNumericField("Intensity", ii, 0);
    gd.addNumericField("Sx", isx, 0);
    gd.addNumericField("Sy", isy, 0);
    gd.addNumericField("Precision", ip, 0);
    // Rearrange
    if (gd.getLayout() != null) {
        GridBagLayout grid = (GridBagLayout) gd.getLayout();
        int xOffset = 0, yOffset = 0;
        int lastY = -1, rowCount = 0;
        for (Component comp : gd.getComponents()) {
            // Check if this should be the second major column
            if (comp == l) {
                xOffset += 2;
                // Skip title row
                yOffset = yOffset - rowCount + 1;
            }
            // Reposition the field
            GridBagConstraints c = grid.getConstraints(comp);
            if (lastY != c.gridy)
                rowCount++;
            lastY = c.gridy;
            c.gridx = c.gridx + xOffset;
            c.gridy = c.gridy + yOffset;
            c.insets.left = c.insets.left + 10 * xOffset;
            c.insets.top = 0;
            c.insets.bottom = 0;
            grid.setConstraints(comp, c);
        }
        if (IJ.isLinux())
            gd.setBackground(new Color(238, 238, 238));
    }
    gd.showDialog();
    if (gd.wasCanceled()) {
        return false;
    }
    name = getNextString(gd, name);
    pixelPitch = gd.getNextNumber();
    gain = gd.getNextNumber();
    exposureTime = gd.getNextNumber();
    header = (int) gd.getNextNumber();
    comment = gd.getNextString();
    delimiter = getNextString(gd, delimiter);
    distanceUnit = gd.getNextChoiceIndex();
    intensityUnit = gd.getNextChoiceIndex();
    int[] columns = new int[9];
    for (int i = 0; i < columns.length; i++) columns[i] = (int) gd.getNextNumber();
    {
        int i = 0;
        it = columns[i++];
        iid = columns[i++];
        ix = columns[i++];
        iy = columns[i++];
        iz = columns[i++];
        ii = columns[i++];
        isx = columns[i++];
        isy = columns[i++];
        ip = columns[i++];
    }
    if (gd.invalidNumber()) {
        IJ.error(TITLE, "Invalid number in input fields");
        return false;
    }
    for (int i = 0; i < columns.length; i++) {
        if (columns[i] < 0)
            continue;
        for (int j = i + 1; j < columns.length; j++) {
            if (columns[j] < 0)
                continue;
            if (columns[i] == columns[j]) {
                IJ.error(TITLE, "Duplicate indicies: " + columns[i]);
                return false;
            }
        }
    }
    if (gain <= 0 || pixelPitch <= 0) {
        IJ.error(TITLE, "Require positive gain and pixel pitch");
        return false;
    }
    if (ix < 0 || iy < 0) {
        IJ.error(TITLE, "Require valid X and Y indices");
        return false;
    }
    return true;
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) GenericDialog(ij.gui.GenericDialog) Color(java.awt.Color) Label(java.awt.Label) Component(java.awt.Component)

Example 24 with GenericDialog

use of ij.gui.GenericDialog in project GDSC-SMLM by aherbert.

the class BenchmarkSmartSpotRanking method showDialog.

private boolean showDialog() {
    GenericDialog gd = new GenericDialog(TITLE);
    gd.addHelp(About.HELP_URL);
    gd.addMessage(String.format("Rank candidate spots in the benchmark image created by " + CreateData.TITLE + " plugin\nand identified by the " + BenchmarkSpotFilter.TITLE + " plugin.\nPSF width = %s nm (Square pixel adjustment = %s nm)\n \nConfigure the fitting:", Utils.rounded(simulationParameters.s), Utils.rounded(getSa())));
    gd.addSlider("Fraction_positives", 50, 100, fractionPositives);
    gd.addSlider("Fraction_negatives_after_positives", 0, 100, fractionNegativesAfterAllPositives);
    gd.addSlider("Min_negatives_after_positives", 0, 10, negativesAfterAllPositives);
    gd.addCheckbox("Select_methods", selectMethods);
    gd.addNumericField("Compact_bins", compactBins, 0);
    gd.addChoice("Sort", SORT, SORT[sortIndex]);
    gd.addCheckbox("Use_fraction_scores", useFractionScores);
    // Collect options for fitting that may effect ranking
    final double sa = getSa();
    gd.addNumericField("Initial_StdDev", sa / simulationParameters.a, 3);
    gd.addSlider("Fitting_width", 2, 4.5, config.getFitting());
    //		gd.addCheckbox("Include_neighbours", config.isIncludeNeighbours());
    //		gd.addSlider("Neighbour_height", 0.01, 1, config.getNeighbourHeightThreshold());
    // Output options
    gd.addCheckbox("Show_overlay", showOverlay);
    if (extraOptions) {
        String[] noiseMethodNames = SettingsManager.getNames((Object[]) Method.values());
        gd.addChoice("Noise_method", noiseMethodNames, noiseMethodNames[config.getNoiseMethod().ordinal()]);
    }
    gd.showDialog();
    if (gd.wasCanceled())
        return false;
    fractionPositives = Math.abs(gd.getNextNumber());
    fractionNegativesAfterAllPositives = Math.abs(gd.getNextNumber());
    negativesAfterAllPositives = (int) Math.abs(gd.getNextNumber());
    selectMethods = gd.getNextBoolean();
    compactBins = (int) Math.abs(gd.getNextNumber());
    sortIndex = gd.getNextChoiceIndex();
    useFractionScores = gd.getNextBoolean();
    // Collect options for fitting that may effect ranking
    fitConfig.setInitialPeakStdDev(gd.getNextNumber());
    config.setFitting(gd.getNextNumber());
    //		config.setIncludeNeighbours(gd.getNextBoolean());
    //		config.setNeighbourHeightThreshold(gd.getNextNumber());
    showOverlay = gd.getNextBoolean();
    if (extraOptions) {
        config.setNoiseMethod(gd.getNextChoiceIndex());
    }
    if (gd.invalidNumber())
        return false;
    methodNames = thresholdMethodNames.clone();
    if (selectMethods) {
        int count = 0, count1 = 0, count2 = 0;
        methods = new AutoThreshold.Method[thresholdMethods.length];
        levels = new double[snrLevels.length];
        gd = new GenericDialog(TITLE);
        gd.addHelp(About.HELP_URL);
        for (int i = 0; i < thresholdMethodNames.length; i++) gd.addCheckbox(thresholdMethodNames[i], thresholdMethodOptions[i]);
        gd.showDialog();
        if (gd.wasCanceled())
            return false;
        for (int i = 0, j = 0; i < thresholdMethodNames.length; i++) {
            thresholdMethodOptions[i] = gd.getNextBoolean();
            if (thresholdMethodOptions[i]) {
                methodNames[count++] = thresholdMethodNames[i];
                if (i < thresholdMethods.length)
                    methods[count1++] = thresholdMethods[i];
                else
                    levels[count2++] = snrLevels[j++];
            }
        }
        methodNames = Arrays.copyOf(methodNames, count);
        methods = Arrays.copyOf(methods, count1);
        levels = Arrays.copyOf(levels, count2);
    } else {
        // Do them all
        methods = thresholdMethods.clone();
        levels = snrLevels.clone();
    }
    if (methodNames.length == 0) {
        IJ.error(TITLE, "No methods selected");
        return false;
    }
    return true;
}
Also used : GenericDialog(ij.gui.GenericDialog) PeakResultPoint(gdsc.smlm.ij.plugins.ResultsMatchCalculator.PeakResultPoint) AutoThreshold(gdsc.core.threshold.AutoThreshold)

Example 25 with GenericDialog

use of ij.gui.GenericDialog in project GDSC-SMLM by aherbert.

the class BenchmarkSpotFit method showDialog.

@SuppressWarnings("unchecked")
private boolean showDialog() {
    GenericDialog gd = new GenericDialog(TITLE);
    gd.addHelp(About.HELP_URL);
    gd.addMessage(String.format("Fit candidate spots in the benchmark image created by " + CreateData.TITLE + " plugin\nand identified by the " + BenchmarkSpotFilter.TITLE + " plugin.\nPSF width = %s nm (Square pixel adjustment = %s nm)\n \nConfigure the fitting:", Utils.rounded(simulationParameters.s), Utils.rounded(getSa())));
    gd.addSlider("Fraction_positives", 50, 100, fractionPositives);
    gd.addSlider("Fraction_negatives_after_positives", 0, 100, fractionNegativesAfterAllPositives);
    gd.addSlider("Min_negatives_after_positives", 0, 10, negativesAfterAllPositives);
    gd.addSlider("Match_distance", 0.5, 3.5, distance);
    gd.addSlider("Lower_distance", 0, 3.5, lowerDistance);
    gd.addSlider("Match_signal", 0, 3.5, signalFactor);
    gd.addSlider("Lower_signal", 0, 3.5, lowerSignalFactor);
    // Collect options for fitting
    final double sa = getSa();
    gd.addNumericField("Initial_StdDev", Maths.round(sa / simulationParameters.a), 3);
    gd.addSlider("Fitting_width", 2, 4.5, config.getFitting());
    String[] solverNames = SettingsManager.getNames((Object[]) FitSolver.values());
    gd.addChoice("Fit_solver", solverNames, solverNames[fitConfig.getFitSolver().ordinal()]);
    String[] functionNames = SettingsManager.getNames((Object[]) FitFunction.values());
    gd.addChoice("Fit_function", functionNames, functionNames[fitConfig.getFitFunction().ordinal()]);
    gd.addMessage("Multi-path filter (used to pick optimum results during fitting)");
    // Allow loading the best filter fot these results
    boolean benchmarkSettingsCheckbox = fitResultsId == BenchmarkFilterAnalysis.lastId;
    // This should always be an opt-in decision. Otherwise the user cannot use the previous settings
    useBenchmarkSettings = false;
    if (benchmarkSettingsCheckbox)
        gd.addCheckbox("Benchmark_settings", useBenchmarkSettings);
    gd.addTextAreas(XmlUtils.convertQuotes(multiFilter.toXML()), null, 6, 60);
    gd.addNumericField("Fail_limit", config.getFailuresLimit(), 0);
    gd.addCheckbox("Include_neighbours", config.isIncludeNeighbours());
    gd.addSlider("Neighbour_height", 0.01, 1, config.getNeighbourHeightThreshold());
    //gd.addSlider("Residuals_threshold", 0.01, 1, config.getResidualsThreshold());
    gd.addCheckbox("Compute_doublets", computeDoublets);
    gd.addNumericField("Duplicate_distance", fitConfig.getDuplicateDistance(), 2);
    gd.addCheckbox("Show_score_histograms", showFilterScoreHistograms);
    gd.addCheckbox("Show_correlation", showCorrelation);
    gd.addCheckbox("Plot_rank_by_intensity", rankByIntensity);
    gd.addCheckbox("Save_filter_range", saveFilterRange);
    if (extraOptions) {
    }
    // Add a mouse listener to the config file field
    if (benchmarkSettingsCheckbox && Utils.isShowGenericDialog()) {
        Vector<TextField> numerics = (Vector<TextField>) gd.getNumericFields();
        Vector<Checkbox> checkboxes = (Vector<Checkbox>) gd.getCheckboxes();
        taFilterXml = gd.getTextArea1();
        Checkbox b = checkboxes.get(0);
        b.addItemListener(this);
        textFailLimit = numerics.get(9);
        cbIncludeNeighbours = checkboxes.get(1);
        textNeighbourHeight = numerics.get(10);
        cbComputeDoublets = checkboxes.get(2);
        if (useBenchmarkSettings) {
            FitConfiguration tmpFitConfig = new FitConfiguration();
            FitEngineConfiguration tmp = new FitEngineConfiguration(tmpFitConfig);
            // Collect the residuals threshold
            tmpFitConfig.setComputeResiduals(true);
            if (BenchmarkFilterAnalysis.updateConfiguration(tmp, false)) {
                textFailLimit.setText("" + tmp.getFailuresLimit());
                cbIncludeNeighbours.setState(tmp.isIncludeNeighbours());
                textNeighbourHeight.setText(Utils.rounded(tmp.getNeighbourHeightThreshold()));
                cbComputeDoublets.setState(tmp.getResidualsThreshold() < 1);
                final DirectFilter primaryFilter = tmpFitConfig.getSmartFilter();
                final double residualsThreshold = tmp.getResidualsThreshold();
                taFilterXml.setText(new MultiPathFilter(primaryFilter, minimalFilter, residualsThreshold).toXML());
            }
        }
    }
    gd.showDialog();
    if (gd.wasCanceled())
        return false;
    fractionPositives = Math.abs(gd.getNextNumber());
    fractionNegativesAfterAllPositives = Math.abs(gd.getNextNumber());
    negativesAfterAllPositives = (int) Math.abs(gd.getNextNumber());
    distance = Math.abs(gd.getNextNumber());
    lowerDistance = Math.abs(gd.getNextNumber());
    signalFactor = Math.abs(gd.getNextNumber());
    lowerSignalFactor = Math.abs(gd.getNextNumber());
    fitConfig.setInitialPeakStdDev(gd.getNextNumber());
    config.setFitting(gd.getNextNumber());
    fitConfig.setFitSolver(gd.getNextChoiceIndex());
    fitConfig.setFitFunction(gd.getNextChoiceIndex());
    boolean myUseBenchmarkSettings = false;
    if (benchmarkSettingsCheckbox)
        //useBenchmarkSettings = 
        myUseBenchmarkSettings = gd.getNextBoolean();
    // Read dialog settings
    String xml = gd.getNextText();
    int failLimit = (int) gd.getNextNumber();
    boolean includeNeighbours = gd.getNextBoolean();
    double neighbourHeightThreshold = gd.getNextNumber();
    boolean myComputeDoublets = gd.getNextBoolean();
    double myDuplicateDistance = gd.getNextNumber();
    MultiPathFilter myMultiFilter = null;
    if (myUseBenchmarkSettings && !Utils.isShowGenericDialog()) {
        // Only copy the benchmark settings if not interactive
        FitConfiguration tmpFitConfig = new FitConfiguration();
        FitEngineConfiguration tmp = new FitEngineConfiguration(tmpFitConfig);
        // Collect the residuals threshold
        tmpFitConfig.setComputeResiduals(true);
        if (BenchmarkFilterAnalysis.updateConfiguration(tmp, false)) {
            config.setFailuresLimit(tmp.getFailuresLimit());
            config.setIncludeNeighbours(tmp.isIncludeNeighbours());
            config.setNeighbourHeightThreshold(tmp.getNeighbourHeightThreshold());
            computeDoublets = (tmp.getResidualsThreshold() < 1);
            fitConfig.setDuplicateDistance(tmpFitConfig.getDuplicateDistance());
            final DirectFilter primaryFilter = tmpFitConfig.getSmartFilter();
            final double residualsThreshold = tmp.getResidualsThreshold();
            myMultiFilter = new MultiPathFilter(primaryFilter, minimalFilter, residualsThreshold);
        }
    } else {
        myMultiFilter = MultiPathFilter.fromXML(xml);
        config.setFailuresLimit(failLimit);
        config.setIncludeNeighbours(includeNeighbours);
        config.setNeighbourHeightThreshold(neighbourHeightThreshold);
        computeDoublets = myComputeDoublets;
        fitConfig.setDuplicateDistance(myDuplicateDistance);
    }
    if (myMultiFilter == null) {
        gd = new GenericDialog(TITLE);
        gd.addMessage("The multi-path filter was invalid.\n \nContinue with a default filter?");
        gd.enableYesNoCancel();
        gd.hideCancelButton();
        gd.showDialog();
        if (!gd.wasOKed())
            return false;
    } else {
        multiFilter = myMultiFilter;
    }
    if (computeDoublets) {
        //config.setComputeResiduals(true);
        config.setResidualsThreshold(0);
        fitConfig.setComputeResiduals(true);
    } else {
        config.setResidualsThreshold(1);
        fitConfig.setComputeResiduals(false);
    }
    showFilterScoreHistograms = gd.getNextBoolean();
    showCorrelation = gd.getNextBoolean();
    rankByIntensity = gd.getNextBoolean();
    saveFilterRange = gd.getNextBoolean();
    // Avoid stupidness, i.e. things that move outside the fit window and are bad widths
    // TODO - Fix this for simple or smart filter...
    fitConfig.setDisableSimpleFilter(false);
    // Realistically we cannot fit lower than this
    fitConfig.setMinPhotons(15);
    // Disable shift as candidates may be re-mapped to alternative candidates so the initial position is wrong.
    fitConfig.setCoordinateShiftFactor(0);
    fitConfig.setMinWidthFactor(1.0 / 5);
    fitConfig.setWidthFactor(5);
    // Disable the direct filter
    fitConfig.setDirectFilter(null);
    if (extraOptions) {
    }
    if (gd.invalidNumber())
        return false;
    if (lowerDistance > distance)
        lowerDistance = distance;
    if (lowerSignalFactor > signalFactor)
        lowerSignalFactor = signalFactor;
    // Distances relative to sa (not s) as this is the same as the BenchmarkSpotFilter plugin 
    distanceInPixels = distance * sa / simulationParameters.a;
    lowerDistanceInPixels = lowerDistance * sa / simulationParameters.a;
    GlobalSettings settings = new GlobalSettings();
    settings.setFitEngineConfiguration(config);
    settings.setCalibration(cal);
    // Copy simulation defaults if a new simulation
    if (lastId != simulationParameters.id) {
        cal.setNmPerPixel(simulationParameters.a);
        cal.setGain(simulationParameters.gain);
        cal.setAmplification(simulationParameters.amplification);
        cal.setExposureTime(100);
        cal.setReadNoise(simulationParameters.readNoise);
        cal.setBias(simulationParameters.bias);
        cal.setEmCCD(simulationParameters.emCCD);
        // This is needed to configure the fit solver
        fitConfig.setNmPerPixel(Maths.round(cal.getNmPerPixel()));
        fitConfig.setGain(Maths.round(cal.getGain()));
        fitConfig.setBias(Maths.round(cal.getBias()));
        fitConfig.setReadNoise(Maths.round(cal.getReadNoise()));
        fitConfig.setAmplification(Maths.round(cal.getAmplification()));
        fitConfig.setEmCCD(cal.isEmCCD());
    }
    if (!PeakFit.configureFitSolver(settings, null, extraOptions))
        return false;
    return true;
}
Also used : FitEngineConfiguration(gdsc.smlm.engine.FitEngineConfiguration) DirectFilter(gdsc.smlm.results.filter.DirectFilter) GlobalSettings(gdsc.smlm.ij.settings.GlobalSettings) PeakResultPoint(gdsc.smlm.ij.plugins.ResultsMatchCalculator.PeakResultPoint) BasePoint(gdsc.core.match.BasePoint) Checkbox(java.awt.Checkbox) FitConfiguration(gdsc.smlm.fitting.FitConfiguration) GenericDialog(ij.gui.GenericDialog) MultiPathFilter(gdsc.smlm.results.filter.MultiPathFilter) TextField(java.awt.TextField) Vector(java.util.Vector)

Aggregations

GenericDialog (ij.gui.GenericDialog)87 NonBlockingGenericDialog (ij.gui.NonBlockingGenericDialog)12 ExtendedGenericDialog (ij.gui.ExtendedGenericDialog)10 GlobalSettings (gdsc.smlm.ij.settings.GlobalSettings)9 Checkbox (java.awt.Checkbox)9 Color (java.awt.Color)8 Component (java.awt.Component)8 GridBagConstraints (java.awt.GridBagConstraints)8 GridBagLayout (java.awt.GridBagLayout)8 Rectangle (java.awt.Rectangle)7 BasePoint (gdsc.core.match.BasePoint)6 FitConfiguration (gdsc.smlm.fitting.FitConfiguration)6 PeakResultPoint (gdsc.smlm.ij.plugins.ResultsMatchCalculator.PeakResultPoint)6 Calibration (gdsc.smlm.results.Calibration)6 ArrayList (java.util.ArrayList)6 PeakResult (gdsc.smlm.results.PeakResult)5 TextField (java.awt.TextField)5 File (java.io.File)5 Vector (java.util.Vector)5 FitEngineConfiguration (gdsc.smlm.engine.FitEngineConfiguration)4