Search in sources :

Example 91 with GenericDialog

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

the class PsfCombiner method combineImages.

private void combineImages() {
    final double nmPerPixel = getNmPerPixel();
    if (nmPerPixel <= 0) {
        return;
    }
    final double nmPerSlice = getNmPerSlice();
    if (nmPerPixel <= 0) {
        return;
    }
    // Find the lowest & highest dimensions
    int minStart = Integer.MAX_VALUE;
    int maxStart = Integer.MIN_VALUE;
    int minEnd = Integer.MAX_VALUE;
    int maxEnd = Integer.MIN_VALUE;
    int minSize = Integer.MAX_VALUE;
    int maxSize = 0;
    for (final Psf psf : input) {
        if (minStart > psf.start) {
            minStart = psf.start;
        }
        if (maxStart < psf.start) {
            maxStart = psf.start;
        }
        if (maxEnd < psf.getEnd()) {
            maxEnd = psf.getEnd();
        }
        if (minEnd > psf.getEnd()) {
            minEnd = psf.getEnd();
        }
        if (maxSize < psf.getSize()) {
            maxSize = psf.getSize();
        }
        if (minSize > psf.getSize()) {
            minSize = psf.getSize();
        }
    }
    int size = maxSize;
    int shift = -minStart;
    int depth = maxEnd - minStart + 1;
    // Option to crop. Do this before processing as it will make the plugin faster
    if (minStart < maxStart || minEnd < maxEnd || minSize < maxSize) {
        boolean crop;
        if (ImageJUtils.isMacro()) {
            final String options = Macro.getOptions();
            crop = options.contains(" crop");
        } else {
            final GenericDialog gd = new GenericDialog(TITLE);
            ImageJUtils.addMessage(gd, "The range of the PSFs is different:\nStart %d to %d\nEnd %d to %d\n" + "Size %d to %d\n \nCrop to the smallest?", minStart, maxStart, minEnd, maxEnd, minSize, maxSize);
            gd.enableYesNoCancel();
            gd.addHelp(HelpUrls.getUrl("psf-combiner"));
            gd.showDialog();
            if (gd.wasCanceled()) {
                return;
            }
            crop = gd.wasOKed();
        }
        if (crop) {
            Recorder.recordOption("crop");
            for (final Psf psf : input) {
                psf.crop(maxStart, minEnd, minSize);
            }
            size = minSize;
            shift = -maxStart;
            depth = minEnd - maxStart + 1;
        }
    }
    // Shift all stacks
    int totalImages = 0;
    for (final Psf psf : input) {
        psf.start += shift;
        totalImages += psf.psfSettings.getImageCount();
    }
    // Create a stack to hold all the images
    // Create a stack to hold the sum of the weights
    final ImageStack stack = new ImageStack(size, size, depth);
    final ImageStack stackW = new ImageStack(size, size, depth);
    for (int n = 1; n <= depth; n++) {
        stack.setPixels(new float[size * size], n);
        stackW.setPixels(new float[size * size], n);
    }
    // Insert all the PSFs
    IJ.showStatus("Creating combined image ...");
    int imageNo = 0;
    final double fraction = 1.0 / input.size();
    for (final Psf psf : input) {
        double progress = imageNo * fraction;
        final ImageStack psfStack = psf.psfStack;
        final int w = psf.getSize();
        final int offsetXy = (size - w) / 2;
        final int offsetZ = psf.start;
        final double weight = (1.0 * psf.psfSettings.getImageCount()) / totalImages;
        final FloatProcessor wp = new FloatProcessor(w, w, SimpleArrayUtils.newFloatArray(psfStack.getWidth() * psfStack.getHeight(), (float) weight));
        final double increment = fraction / psfStack.getSize();
        for (int n = 1; n <= psfStack.getSize(); n++) {
            progress += increment;
            IJ.showProgress(progress);
            // Get the data and adjust using the weight
            final float[] psfData = ImageJImageConverter.getData(psfStack.getProcessor(n));
            for (int i = 0; i < psfData.length; i++) {
                psfData[i] *= weight;
            }
            // Insert into the combined PSF
            final int slice = n + offsetZ;
            ImageProcessor ip = stack.getProcessor(slice);
            ip.copyBits(new FloatProcessor(w, w, psfData), offsetXy, offsetXy, Blitter.ADD);
            // Insert the weights
            ip = stackW.getProcessor(slice);
            ip.copyBits(wp, offsetXy, offsetXy, Blitter.ADD);
        }
        imageNo++;
    }
    // Normalise
    for (int n = 1; n <= depth; n++) {
        stack.getProcessor(n).copyBits(stackW.getProcessor(n), 0, 0, Blitter.DIVIDE);
    }
    ImageJUtils.finished();
    final ImagePlus imp = ImageJUtils.display("Combined PSF", stack);
    imp.setSlice(1 + shift);
    imp.resetDisplayRange();
    imp.updateAndDraw();
    final double fwhm = getFwhm();
    imp.setProperty("Info", ImagePsfHelper.toString(ImagePsfHelper.create(imp.getSlice(), nmPerPixel, nmPerSlice, totalImages, fwhm)));
    ImageJUtils.log("%s : z-centre = %d, nm/Pixel = %s, nm/Slice = %s, %d images, FWHM = %s\n", imp.getTitle(), imp.getSlice(), MathUtils.rounded(nmPerPixel), MathUtils.rounded(nmPerSlice), totalImages, MathUtils.rounded(fwhm));
}
Also used : ImageProcessor(ij.process.ImageProcessor) ImageStack(ij.ImageStack) FloatProcessor(ij.process.FloatProcessor) GenericDialog(ij.gui.GenericDialog) ImagePlus(ij.ImagePlus)

Example 92 with GenericDialog

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

the class PsfCreator method subtractBackgroundAndWindow.

/**
 * Subtract the background from the spot, compute the intensity within half the box region
 * distance from the centre and smooth the intensity profile. In interactive mode the user must
 * choose to accept the profile or reject. If accepted the smoothed profile is user to normalise
 * the image and then the image is rolled off to zero using a Tukey window function.
 *
 * @param spot the spot
 * @param background The minimum level, all below this is background and set to zero
 * @param spotWidth the spot width
 * @param spotHeight the spot height
 * @param centre the centre
 * @param loess The smoothing interpolator
 * @return True if accepted
 */
private boolean subtractBackgroundAndWindow(float[][] spot, final float background, final int spotWidth, final int spotHeight, double[] centre, LoessInterpolator loess) {
    // ImageWindow imageWindow = new ImageWindow();
    for (int i = 0; i < spot.length; i++) {
        for (int j = 0; j < spot[i].length; j++) {
            spot[i][j] = Math.max(spot[i][j] - background, 0);
        }
    }
    // Create a distance map from the centre
    if (lastWidth != spotWidth || lastHeight != spotHeight) {
        final double cx = spotWidth * 0.5;
        final double cy = spotHeight * 0.5;
        minx = Math.max(0, (int) (cx - boxRadius * 0.5));
        maxx = Math.min(spotWidth, (int) Math.ceil(cx + boxRadius * 0.5));
        miny = Math.max(0, (int) (cy - boxRadius * 0.5));
        maxy = Math.min(spotHeight, (int) Math.ceil(cy + boxRadius * 0.5));
        // Precompute square distances
        final double[] dx2 = new double[maxx - minx + 1];
        for (int x = minx, i = 0; x < maxx; x++, i++) {
            // Use pixel centres with 0.5 offset
            final double dx = x + 0.5 - cx;
            dx2[i] = dx * dx;
        }
        dmap = new boolean[dx2.length * (maxy - miny + 1)];
        final int halfBoxRadius = boxRadius / 2;
        final double d2 = halfBoxRadius * halfBoxRadius;
        for (int y = miny, j = 0; y < maxy; y++) {
            final double dy = (y + 0.5 - cy);
            final double dy2 = dy * dy;
            final double limit = d2 - dy2;
            for (int x = minx, i = 0; x < maxx; x++, i++, j++) {
                dmap[j] = (dx2[i] < limit);
            }
        }
        lastWidth = spotWidth;
        lastHeight = spotHeight;
    }
    // Calculate the intensity profile within half the box radius from the centre
    final double[] xValues = new double[spot.length];
    final double[] yValues = new double[spot.length];
    for (int i = 0; i < spot.length; i++) {
        xValues[i] = i + 1;
        double sum = 0;
        for (int y = miny, j = 0; y < maxy; y++) {
            int index = y * spotWidth + minx;
            for (int x = minx; x < maxx; x++, index++, j++) {
                if (dmap[j]) {
                    sum += spot[i][index];
                }
            }
        }
        yValues[i] = sum;
    }
    final double[] newY = loess.smooth(xValues, yValues);
    // falls towards zero at the ends)
    for (int i = 0; i < newY.length; i++) {
        if (newY[i] < 0) {
            newY[i] = yValues[i];
        }
    }
    if (settings.getInteractiveMode()) {
        ImageJUtils.hide(TITLE_AMPLITUDE);
        ImageJUtils.hide(TITLE_PSF_PARAMETERS);
        final int n = (int) centre[4];
        final String title = TITLE_INTENSITY;
        final Plot plot = new Plot(title, "Slice", "Sum");
        plot.addPoints(xValues, yValues, Plot.LINE);
        plot.setColor(Color.red);
        plot.addPoints(xValues, newY, Plot.LINE);
        plot.setColor(Color.green);
        final double[] limits = MathUtils.limits(yValues);
        plot.drawLine(centre[2], limits[0], centre[2], limits[1]);
        plot.setColor(Color.black);
        plot.addLabel(0, 0, "Spot " + n);
        ImageJUtils.display(title, plot);
        final GenericDialog gd = new GenericDialog(TITLE);
        gd.enableYesNoCancel();
        gd.hideCancelButton();
        ImageJUtils.addMessage(gd, "Add spot %d to the PSF?\n(The intensity profile is the sum within half the box region)", n);
        final Point previousPoint = yesNoPosition.get();
        if (previousPoint != null) {
            gd.centerDialog(false);
            gd.setLocation(previousPoint);
        }
        gd.showDialog();
        yesNoPosition.set(gd.getLocation());
        if (!gd.wasOKed()) {
            return false;
        }
    }
    for (int i = 0; i < spot.length; i++) {
        // Normalise
        final float scale = (float) (newY[i] / yValues[i]);
        for (int j = 0; j < spot[i].length; j++) {
            spot[i][j] *= scale;
        }
        // Use a Tukey window to roll-off the image edges
        // spot[i] = imageWindow.applySeperable(spot[i], spotWidth, spotHeight,
        // ImageWindow.WindowFunction.Tukey);
        spot[i] = ImageWindow.applyWindow(spot[i], spotWidth, spotHeight, ImageWindow.WindowMethod.TUKEY);
    }
    return true;
}
Also used : Plot(ij.gui.Plot) GenericDialog(ij.gui.GenericDialog) 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) Point(java.awt.Point) BasePoint(uk.ac.sussex.gdsc.core.match.BasePoint)

Example 93 with GenericDialog

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

the class PixelFilter method showDialog.

@Override
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) {
    this.pfr = pfr;
    preview = true;
    final GenericDialog gd = new GenericDialog(TITLE);
    gd.addHelp(HelpUrls.getUrl("pixel-filter"));
    gd.addMessage("Replace pixels with mean if they are N StdDevs from the mean");
    settings = Settings.load();
    settings.save();
    gd.addSlider("Radius", 1, 5, settings.radius);
    gd.addSlider("Error (SD units)", 2.5, 7, settings.error);
    gd.addPreviewCheckbox(pfr);
    gd.addDialogListener(this);
    gd.addMessage("");
    label = (Label) gd.getMessage();
    gd.showDialog();
    if (gd.wasCanceled() || !dialogItemChanged(gd, null)) {
        return DONE;
    }
    preview = false;
    cachedRollingSum = cachedRollingSumSq = null;
    label = null;
    return IJ.setupDialog(imp, FLAGS);
}
Also used : GenericDialog(ij.gui.GenericDialog)

Example 94 with GenericDialog

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

the class TcPalmAnalysis method analyseRois.

/**
 * Analyses all the ROIs in the ROI manager.
 *
 * @param event the event
 */
private void analyseRois(ActionEvent event) {
    final RoiManager manager = RoiManager.getInstance();
    if (manager == null) {
        IJ.error(TITLE, "ROI manager is not open");
        return;
    }
    final LocalList<Roi> rois = Arrays.stream(manager.getRoisAsArray()).filter(Roi::isArea).collect(LocalCollectors.toLocalList());
    if (rois.isEmpty()) {
        IJ.error(TITLE, "No area ROIs");
        return;
    }
    // Check for overlaps.
    if (!settings.getDisableOverlapCheck() && anyOverlap(rois)) {
        final GenericDialog gd = new GenericDialog(TITLE);
        gd.addMessage(TextUtils.wrap("WARNING - Bounding rectangles of ROIs overlap. You can verify " + "the ROIs on the image using the ROI manager 'Show all' function.", 80));
        gd.setOKLabel("Continue");
        gd.showDialog();
        if (gd.wasCanceled()) {
            return;
        }
    }
    // For each ROI:
    // - Extract the current groups
    // - Build the cumulative count plot
    // - Identify the bursts
    // - Extract ClusterData for each burst
    final TcPalmAnalysisSettings settings = this.settings.build();
    final LocalList<ClusterData> allClusters = rois.parallelStream().map(roi -> {
        final Rectangle2D scaledBounds = createScaledBounds(roi);
        final BiPredicate<ClusterData, Rectangle2D> filter = createSelectionFilter(roi, settings);
        // Filter all cluster groups
        final LocalList<ClusterData> clusters = new LocalList<>();
        clusterData.forEach(c -> {
            if (filter.test(c, scaledBounds)) {
                clusters.add(c);
            }
        });
        // Extract activation bursts
        final CumulativeCountData countData = createCumulativeCountData(clusters, false);
        final LocalList<int[]> bursts = runBurstAnalysis(settings, countData);
        final LocalList<LocalList<PeakResult>> burstLocalisations = createBurstLocalisations(clusters, bursts);
        clusters.clear();
        burstLocalisations.forEach(list -> {
            final ClusterData d = new ClusterData(clusters.size() + 1, list);
            // Save this for analysis
            d.sourceRoi = roi;
            d.getArea();
            clusters.add(d);
        });
        return clusters;
    }).collect(LocalList::new, LocalList::addAll, LocalList::addAll);
    // Reorder
    final Counter count = new Counter();
    allClusters.forEach(c -> c.id = count.incrementAndGet());
    // Display in a table
    final ClusterDataTableModelFrame frame = createAllClustersTable();
    frame.getModel().setData(allClusters, dataCalibration);
    // Allow the results to be repeated
    frame.selectedAction = clusters -> {
        // Expecting a single cluster. No clusters occurs when the table (and selection) is cleared.
        if (clusters.size() == 1) {
            final ClusterData c = clusters.get(0);
            // Push the correct ROI and settings to the analysis action.
            // We do not directly update the ROI or dialog settings as
            // these trigger events that are processed to add work with a delay.
            // Updating them at the end should generate events that are
            // ignored when finally executed as the ROI/settings should be the same.
            addWork(0, c.sourceRoi, settings, () -> {
                // When analysis has finished update the settings and image ROI.
                image.getImagePlus().setRoi(c.sourceRoi);
                darkTimeToleranceTextField.setText(Integer.toString(settings.getDarkTimeTolerance()));
                minClusterSizeTextField.setText(Integer.toString(settings.getMinClusterSize()));
                // When analysis has finished the cluster should be selected in the
                // current clusters table.
                final ClusterDataTableModelFrame currentClusters = currentClustersTable.get();
                if (currentClusters != null) {
                    currentClusters.select(c);
                }
            });
        }
    };
    // Show histogram of cluster size/duration
    reportAnalysis(settings, allClusters, dataCalibration);
    // Save clusters to memory
    final Trace[] traces = allClusters.stream().map(c -> {
        final Trace t = new Trace();
        t.setId(c.id);
        c.results.forEach(t::add);
        return t;
    }).toArray(Trace[]::new);
    TraceMolecules.saveResults(results, traces, "TC PALM");
    IJ.showStatus(TITLE + ": " + TextUtils.pleural(allClusters.size(), "cluster"));
}
Also used : Color(java.awt.Color) Arrays(java.util.Arrays) Calibration(uk.ac.sussex.gdsc.smlm.data.config.CalibrationProtos.Calibration) IntUnaryOperator(java.util.function.IntUnaryOperator) Rectangle2D(java.awt.geom.Rectangle2D) HistogramPlotBuilder(uk.ac.sussex.gdsc.core.ij.HistogramPlot.HistogramPlotBuilder) IdFramePeakResultComparator(uk.ac.sussex.gdsc.smlm.results.sort.IdFramePeakResultComparator) UnaryOperator(java.util.function.UnaryOperator) Hull(uk.ac.sussex.gdsc.core.math.hull.Hull) TableCellRenderer(javax.swing.table.TableCellRenderer) ResultsSettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsSettings) FloatUnaryOperator(uk.ac.sussex.gdsc.core.utils.function.FloatUnaryOperator) MemoryPeakResults(uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults) RoiManager(ij.plugin.frame.RoiManager) RowSorter(javax.swing.RowSorter) SoftLock(uk.ac.sussex.gdsc.core.utils.SoftLock) JFrame(javax.swing.JFrame) LutHelper(uk.ac.sussex.gdsc.core.ij.process.LutHelper) KeyStroke(javax.swing.KeyStroke) TableModelEvent(javax.swing.event.TableModelEvent) InputSource(uk.ac.sussex.gdsc.smlm.ij.plugins.ResultsManager.InputSource) DistanceUnit(uk.ac.sussex.gdsc.smlm.data.config.UnitProtos.DistanceUnit) KeyEvent(java.awt.event.KeyEvent) WindowAdapter(java.awt.event.WindowAdapter) ConcurrencyUtils(uk.ac.sussex.gdsc.core.utils.concurrent.ConcurrencyUtils) Component(java.awt.Component) Hull2d(uk.ac.sussex.gdsc.core.math.hull.Hull2d) TextUtils(uk.ac.sussex.gdsc.core.utils.TextUtils) Plot(ij.gui.Plot) Executors(java.util.concurrent.Executors) CalibrationHelper(uk.ac.sussex.gdsc.smlm.data.config.CalibrationHelper) ImagePlus(ij.ImagePlus) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer) ToDoubleFunction(java.util.function.ToDoubleFunction) TcPalmAnalysisSettings(uk.ac.sussex.gdsc.smlm.ij.settings.GUIProtos.TcPalmAnalysisSettings) FileUtils(uk.ac.sussex.gdsc.core.utils.FileUtils) PlugIn(ij.plugin.PlugIn) ListSelectionModel(javax.swing.ListSelectionModel) ActionListener(java.awt.event.ActionListener) PolygonRoi(ij.gui.PolygonRoi) StoredData(uk.ac.sussex.gdsc.core.utils.StoredData) FrameCounter(uk.ac.sussex.gdsc.smlm.results.count.FrameCounter) WindowManager(ij.WindowManager) ConvexHull2d(uk.ac.sussex.gdsc.core.math.hull.ConvexHull2d) PeakResult(uk.ac.sussex.gdsc.smlm.results.PeakResult) PointRoi(ij.gui.PointRoi) Trace(uk.ac.sussex.gdsc.smlm.results.Trace) GenericDialog(ij.gui.GenericDialog) AbstractTableModel(javax.swing.table.AbstractTableModel) SortUtils(uk.ac.sussex.gdsc.core.utils.SortUtils) RounderUtils(uk.ac.sussex.gdsc.core.data.utils.RounderUtils) Overlay(ij.gui.Overlay) Files(java.nio.file.Files) BufferedWriter(java.io.BufferedWriter) Window(java.awt.Window) IOException(java.io.IOException) JScrollPane(javax.swing.JScrollPane) RoiListener(ij.gui.RoiListener) Paths(java.nio.file.Paths) ConcurrentMonoStack(uk.ac.sussex.gdsc.core.utils.concurrent.ConcurrentMonoStack) ListSelectionListener(javax.swing.event.ListSelectionListener) TIntArrayList(gnu.trove.list.array.TIntArrayList) IdentityTypeConverter(uk.ac.sussex.gdsc.core.data.utils.IdentityTypeConverter) Point(java.awt.Point) CoordinatePredicateUtils(uk.ac.sussex.gdsc.core.ij.roi.CoordinatePredicateUtils) ResultsImageSettings(uk.ac.sussex.gdsc.smlm.data.config.ResultsProtos.ResultsImageSettings) ImageJPluginLoggerHelper(uk.ac.sussex.gdsc.core.ij.ImageJPluginLoggerHelper) LocalCollectors(uk.ac.sussex.gdsc.core.utils.LocalCollectors) ImageJImagePeakResults(uk.ac.sussex.gdsc.smlm.ij.results.ImageJImagePeakResults) NonBlockingExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.NonBlockingExtendedGenericDialog) ScreenDimensionHelper(uk.ac.sussex.gdsc.core.ij.gui.ScreenDimensionHelper) PlotWindow(ij.gui.PlotWindow) ListSelectionEvent(javax.swing.event.ListSelectionEvent) SettingsManager(uk.ac.sussex.gdsc.smlm.ij.settings.SettingsManager) JMenuBar(javax.swing.JMenuBar) CoordinatePredicate(uk.ac.sussex.gdsc.core.ij.roi.CoordinatePredicate) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog) PeakResultsList(uk.ac.sussex.gdsc.smlm.results.PeakResultsList) JMenu(javax.swing.JMenu) TIntIntHashMap(gnu.trove.map.hash.TIntIntHashMap) OffsetPointRoi(uk.ac.sussex.gdsc.core.ij.gui.OffsetPointRoi) WindowEvent(java.awt.event.WindowEvent) DoubleStream(java.util.stream.DoubleStream) Objects(java.util.Objects) List(java.util.List) SimpleArrayUtils(uk.ac.sussex.gdsc.core.utils.SimpleArrayUtils) JTable(javax.swing.JTable) LUT(ij.process.LUT) TypeConverter(uk.ac.sussex.gdsc.core.data.utils.TypeConverter) Roi(ij.gui.Roi) Rectangle(java.awt.Rectangle) WindowOrganiser(uk.ac.sussex.gdsc.core.ij.plugin.WindowOrganiser) AtomicReference(java.util.concurrent.atomic.AtomicReference) SwingConstants(javax.swing.SwingConstants) TextField(java.awt.TextField) Level(java.util.logging.Level) AWTEvent(java.awt.AWTEvent) BiPredicate(java.util.function.BiPredicate) SwingUtilities(javax.swing.SwingUtilities) JMenuItem(javax.swing.JMenuItem) ImagePeakResultsFactory(uk.ac.sussex.gdsc.smlm.ij.results.ImagePeakResultsFactory) UnitHelper(uk.ac.sussex.gdsc.smlm.data.config.UnitHelper) ExecutorService(java.util.concurrent.ExecutorService) LutColour(uk.ac.sussex.gdsc.core.ij.process.LutHelper.LutColour) ActionEvent(java.awt.event.ActionEvent) Rounder(uk.ac.sussex.gdsc.core.data.utils.Rounder) TimeUnit(uk.ac.sussex.gdsc.smlm.data.config.UnitProtos.TimeUnit) Consumer(java.util.function.Consumer) Counter(uk.ac.sussex.gdsc.smlm.results.count.Counter) ImageJUtils(uk.ac.sussex.gdsc.core.ij.ImageJUtils) TableColumnAdjuster(uk.ac.sussex.gdsc.smlm.ij.gui.TableColumnAdjuster) IJ(ij.IJ) DoublePredicate(java.util.function.DoublePredicate) Collections(java.util.Collections) LocalList(uk.ac.sussex.gdsc.core.utils.LocalList) Rectangle2D(java.awt.geom.Rectangle2D) PolygonRoi(ij.gui.PolygonRoi) PointRoi(ij.gui.PointRoi) OffsetPointRoi(uk.ac.sussex.gdsc.core.ij.gui.OffsetPointRoi) Roi(ij.gui.Roi) RoiManager(ij.plugin.frame.RoiManager) PeakResult(uk.ac.sussex.gdsc.smlm.results.PeakResult) Trace(uk.ac.sussex.gdsc.smlm.results.Trace) LocalList(uk.ac.sussex.gdsc.core.utils.LocalList) FrameCounter(uk.ac.sussex.gdsc.smlm.results.count.FrameCounter) Counter(uk.ac.sussex.gdsc.smlm.results.count.Counter) GenericDialog(ij.gui.GenericDialog) NonBlockingExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.NonBlockingExtendedGenericDialog) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog) TcPalmAnalysisSettings(uk.ac.sussex.gdsc.smlm.ij.settings.GUIProtos.TcPalmAnalysisSettings) BiPredicate(java.util.function.BiPredicate)

Example 95 with GenericDialog

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

the class PulseActivationAnalysis method isSimulation.

private int isSimulation() {
    if (ImageJUtils.isExtraOptions()) {
        final GenericDialog gd = new GenericDialog(title);
        gd.addMessage("Perform a crosstalk simulation?");
        gd.enableYesNoCancel();
        gd.addHelp(HelpUrls.getUrl(helpKey));
        gd.showDialog();
        if (gd.wasOKed()) {
            return 1;
        }
        if (gd.wasCanceled()) {
            return -1;
        }
    }
    return 0;
}
Also used : NonBlockingExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.NonBlockingExtendedGenericDialog) ExtendedGenericDialog(uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog) GenericDialog(ij.gui.GenericDialog)

Aggregations

GenericDialog (ij.gui.GenericDialog)236 ExtendedGenericDialog (uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog)45 ArrayList (java.util.ArrayList)31 ImagePlus (ij.ImagePlus)25 Rectangle (java.awt.Rectangle)21 File (java.io.File)21 NonBlockingGenericDialog (ij.gui.NonBlockingGenericDialog)20 Point (java.awt.Point)20 Color (java.awt.Color)17 NonBlockingExtendedGenericDialog (uk.ac.sussex.gdsc.core.ij.gui.NonBlockingExtendedGenericDialog)15 Roi (ij.gui.Roi)14 IOException (java.io.IOException)14 Checkbox (java.awt.Checkbox)13 Component (java.awt.Component)13 TextField (java.awt.TextField)13 Vector (java.util.Vector)12 List (java.util.List)11 Worker (ini.trakem2.utils.Worker)10 GridBagConstraints (java.awt.GridBagConstraints)10 Choice (java.awt.Choice)9